
package com.ami.iusb;

import java.io.EOFException;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MBR {
	RandomAccessFile pImg = null;
	FileChannel ImgChannel = null;
	RandomAccessFile fileRaf = null;
	FileChannel fileChannel = null;

	FileList[] FileList_array = null;
	long g_fat_index = 0L;
	long image_create_time = 0L;
	long FileListCreatTime = 0L;
	long fat32_free_cluster = 0L;

	public static int FAT_RESERVED_RECORD_NUM = 0;
	public static int FAT_RECORD_SIZE = 0;
	public static int PARTITION_TABLE_SIZE = 16;
	public static int BOOT_INDICATOR = 446;
	public static int BOOT_SECTOR_SIZE = 512;
	public static int ROOT_DIR_ENTRY_SIZE = 32;
	public static int LITTLE_ENDIAN_TYPE = 0;
	public static int BIG_ENDIAN_TYPE = 1;
	public static byte FILE_ATTRI_HIDDEN = 2;
	public static byte FILE_ATTRI_SYSTEM = 4;
	public static byte FILE_ATTRI_SUBFOLDER = 16;
	public static byte FILE_ATTRI_FILE = 32;
	public static int UNSIGNED_BYTE_MASK = 255;
	public static int UNSIGNED_SHORT_MASK = 65535;
	public static long UNSIGNED_INT_MASK = -1L;
	public static int LFN_CHAR_LEN_IN_BYTE = 26;
	public static int LFN_CHAR_SIZE = 13;
	public static int NON_MULTI_CLUSTER = -1;

	public int first_byte = 0;
	public int[] start_chs = new int[3];
	public int partition_type = 0;
	public int[] end_chs = new int[3];
	public long start_sector = 0L;
	public long length_sector = 0L;

	public int[] jmp = new int[3];
	public char[] oem = new char[8];
	public int sector_size = 0;
	public int sectors_per_cluster = 0;
	public int reserved_sector = 0;
	public int number_of_fat = 0;
	public int root_dir_entry = 0;
	public int total_block = 0;
	public int media_descriptor = 0;
	public int fat_size_sector = 0;
	public int sector_per_track = 0;
	public int number_of_head = 0;
	public long hidden_sector = 0L;
	public long total_sector_long = 0L;
	public long fat32_fat_size_sector = 0L;
	public int fat32_flag = 0;
	public int fat32_version = 0;
	public long fat32_root_start_cluster = 0L;
	public int fat32_fsinfo_addr = 0;
	public int fat32_backup_fsinfo_addr = 0;
	public byte[] fat32_reserved = new byte[12];
	public int drive_number = 0;
	public int current_head = 0;
	public int boot_signature = 0;
	public long volume_id = 0L;
	public char[] volume_label = new char[11];
	public char[] fs_type = new char[8];

	public char[] boot_code;

	public int boot_sector_signature;
	public long fat_start_addr = 0L;
	public long root_start_addr = 0L;
	public long data_start_addr = 0L;
	public long fat32_fat2_addr = 0L;
	public long fat32_fsinfo1_addr = 0L;
	public long fat32_fsinfo2_addr = 0L;
	public byte lfn_sequence = 49;
	public boolean using_fat16 = false;

	public long folder_size = 0L;
	public long copyed_size = 0L;
	public int complete_percent = 0;
	public boolean user_stop_flag = false;

	public MBR(RandomAccessFile paramRandomAccessFile) {
		this.pImg = paramRandomAccessFile;
	}

	public MBR(String paramString1, String paramString2, long paramLong) {
		this.folder_size = 0L;
		this.copyed_size = 0L;

		byte[] arrayOfByte1 = new byte[BOOT_SECTOR_SIZE];
		ByteBuffer localByteBuffer = null;

		try {
			File localFile1 = new File(paramString1);
			if (localFile1.exists()) {
				localFile1.delete();
			}

			this.pImg = new RandomAccessFile(paramString1, "rw");
			this.pImg.setLength(paramLong * 1000L * 1024L * 1024L);

			File localFile2 = new File(paramString1);
			this.image_create_time = localFile2.lastModified();
		} catch (Exception localException1) {
			localException1.printStackTrace();
		}
		this.ImgChannel = this.pImg.getChannel();

		if (paramLong <= 2L) {
			FAT_RESERVED_RECORD_NUM = 2;
			FAT_RECORD_SIZE = 2;
			this.boot_code = new char['ǀ'];
			this.using_fat16 = true;
		} else {
			FAT_RESERVED_RECORD_NUM = 3;
			FAT_RECORD_SIZE = 4;
			this.boot_code = new char['Ƥ'];
			this.using_fat16 = false;
		}
		try {
			if (this.using_fat16) {
				this.jmp[0] = 235;
				this.jmp[1] = 60;
				this.jmp[2] = 144;
			} else {
				this.jmp[0] = 235;
				this.jmp[1] = 88;
				this.jmp[2] = 144;
			}

			this.oem[0] = 'M';
			this.oem[1] = 'S';
			this.oem[2] = 'D';
			this.oem[3] = 'O';
			this.oem[4] = 'S';
			this.oem[5] = '5';
			this.oem[6] = '.';
			this.oem[7] = '0';

			this.sector_size = ChangeToLittleEndian(512, 2, LITTLE_ENDIAN_TYPE);
			if (paramLong == 1L) {
				this.sectors_per_cluster = 32;
			} else if (paramLong == 2L) {
				this.sectors_per_cluster = 64;
			} else if ((paramLong > 2L) && (paramLong <= 8L)) {
				this.sectors_per_cluster = 8;
			} else if ((paramLong > 8L) && (paramLong <= 16L)) {
				this.sectors_per_cluster = 16;
			} else if ((paramLong > 16L) && (paramLong <= 32L)) {
				this.sectors_per_cluster = 32;
			} else if (paramLong > 32L) {
				this.sectors_per_cluster = 64;
			}
			if (this.using_fat16) {
				this.reserved_sector = ChangeToLittleEndian(6, 2, LITTLE_ENDIAN_TYPE);
			} else {
				this.reserved_sector = ChangeToLittleEndian(38, 2, LITTLE_ENDIAN_TYPE);
			}

			this.number_of_fat = 2;

			if (this.using_fat16) {
				this.root_dir_entry = ChangeToLittleEndian(512, 2, LITTLE_ENDIAN_TYPE);
			} else {
				this.root_dir_entry = ChangeToLittleEndian(0, 2, LITTLE_ENDIAN_TYPE);
			}

			this.total_block = ChangeToLittleEndian(0, 2, LITTLE_ENDIAN_TYPE);
			this.media_descriptor = 248;

			if (this.using_fat16) {
				this.fat_size_sector = ChangeToLittleEndian((int) calculateFATTableSize(), 2, LITTLE_ENDIAN_TYPE);
			} else {
				this.fat_size_sector = ChangeToLittleEndian(0, 2, LITTLE_ENDIAN_TYPE);
			}
			this.sector_per_track = ChangeToLittleEndian(63, 2, LITTLE_ENDIAN_TYPE);
			this.number_of_head = ChangeToLittleEndian(255, 2, LITTLE_ENDIAN_TYPE);
			if (this.using_fat16) {
				this.hidden_sector = ChangeToLittleEndian(63, 4, LITTLE_ENDIAN_TYPE);
			} else
				this.hidden_sector = ChangeToLittleEndian(0, 4, LITTLE_ENDIAN_TYPE);
			this.total_sector_long = ChangeToLittleEndian((int) (this.pImg.length() / 512L), 4, LITTLE_ENDIAN_TYPE);

			if (!this.using_fat16) {
				this.fat32_fat_size_sector = ChangeToLittleEndian((int) calculateFATTableSize(), 4, LITTLE_ENDIAN_TYPE);

				this.fat32_flag = 0;
				this.fat32_version = 0;
				this.fat32_root_start_cluster = ChangeToLittleEndian(2, 4, LITTLE_ENDIAN_TYPE);
				this.fat32_fsinfo_addr = ChangeToLittleEndian(1, 2, LITTLE_ENDIAN_TYPE);
				this.fat32_backup_fsinfo_addr = ChangeToLittleEndian(6, 2, LITTLE_ENDIAN_TYPE);
				for (int i = 0; i < this.fat32_reserved.length; i++) {
					this.fat32_reserved[i] = 0;
				}
			}
			this.drive_number = 128;
			this.current_head = 0;
			this.boot_signature = 41;
			this.volume_id = ChangeToLittleEndian(308538333, 4, LITTLE_ENDIAN_TYPE);
			this.volume_label[0] = 'N';
			this.volume_label[1] = 'O';
			this.volume_label[2] = ' ';
			this.volume_label[3] = 'N';
			this.volume_label[4] = 'A';
			this.volume_label[5] = 'M';
			this.volume_label[6] = 'E';
			this.volume_label[7] = ' ';
			this.volume_label[8] = ' ';
			this.volume_label[9] = ' ';
			this.volume_label[10] = ' ';
			this.fs_type[0] = 'F';
			this.fs_type[1] = 'A';
			this.fs_type[2] = 'T';
			if (this.using_fat16) {
				this.fs_type[3] = '1';
				this.fs_type[4] = '6';
			} else {
				this.fs_type[3] = '3';
				this.fs_type[4] = '2';
			}
			this.fs_type[5] = ' ';
			this.fs_type[6] = ' ';
			this.fs_type[7] = ' ';
			if (this.using_fat16) {
				fat16_boot_code_init();
			} else {
				fat32_boot_code_init();
			}
			this.boot_sector_signature = ChangeToLittleEndian(43605, 2, LITTLE_ENDIAN_TYPE);

			for (int i = 0; i < 3; i++)
				arrayOfByte1[i] = ((byte) this.jmp[i]);
			for (int i = 0; i < 8; i++)
				arrayOfByte1[(i + 3)] = ((byte) this.oem[i]);
			arrayOfByte1[11] = ((byte) ((this.sector_size & 0xFF00) >> 8));
			arrayOfByte1[12] = ((byte) (this.sector_size & 0xFF));
			arrayOfByte1[13] = ((byte) this.sectors_per_cluster);
			arrayOfByte1[14] = ((byte) ((this.reserved_sector & 0xFF00) >> 8));
			arrayOfByte1[15] = ((byte) (this.reserved_sector & 0xFF));
			arrayOfByte1[16] = ((byte) this.number_of_fat);
			arrayOfByte1[17] = ((byte) ((this.root_dir_entry & 0xFF00) >> 8));
			arrayOfByte1[18] = ((byte) (this.root_dir_entry & 0xFF));
			arrayOfByte1[19] = ((byte) ((this.total_block & 0xFF00) >> 8));
			arrayOfByte1[20] = ((byte) (this.total_block & 0xFF));
			arrayOfByte1[21] = ((byte) this.media_descriptor);
			arrayOfByte1[22] = ((byte) ((this.fat_size_sector & 0xFF00) >> 8));
			arrayOfByte1[23] = ((byte) (this.fat_size_sector & 0xFF));
			arrayOfByte1[24] = ((byte) ((this.sector_per_track & 0xFF00) >> 8));
			arrayOfByte1[25] = ((byte) (this.sector_per_track & 0xFF));
			arrayOfByte1[26] = ((byte) ((this.number_of_head & 0xFF00) >> 8));
			arrayOfByte1[27] = ((byte) (this.number_of_head & 0xFF));
			arrayOfByte1[28] = ((byte) (int) ((this.hidden_sector & 0xFF000000) >> 24));
			arrayOfByte1[29] = ((byte) (int) ((this.hidden_sector & 0xFF0000) >> 16));
			arrayOfByte1[30] = ((byte) (int) ((this.hidden_sector & 0xFF00) >> 8));
			arrayOfByte1[31] = ((byte) (int) (this.hidden_sector & 0xFF));
			arrayOfByte1[32] = ((byte) (int) ((this.total_sector_long & 0xFF000000) >> 24));
			arrayOfByte1[33] = ((byte) (int) ((this.total_sector_long & 0xFF0000) >> 16));
			arrayOfByte1[34] = ((byte) (int) ((this.total_sector_long & 0xFF00) >> 8));
			arrayOfByte1[35] = ((byte) (int) (this.total_sector_long & 0xFF));
			if (this.using_fat16) {
				arrayOfByte1[36] = ((byte) this.drive_number);
				arrayOfByte1[37] = ((byte) this.current_head);
				arrayOfByte1[38] = ((byte) this.boot_signature);
				arrayOfByte1[39] = ((byte) (int) ((this.volume_id & 0xFF000000) >> 24));
				arrayOfByte1[40] = ((byte) (int) ((this.volume_id & 0xFF0000) >> 16));
				arrayOfByte1[41] = ((byte) (int) ((this.volume_id & 0xFF00) >> 8));
				arrayOfByte1[42] = ((byte) (int) (this.volume_id & 0xFF));
				for (int i = 0; i < this.volume_label.length; i++)
					arrayOfByte1[(i + 43)] = ((byte) this.volume_label[i]);
				for (int i = 0; i < this.fs_type.length; i++)
					arrayOfByte1[(i + 54)] = ((byte) this.fs_type[i]);
				for (int i = 0; i < this.boot_code.length; i++) {
					arrayOfByte1[(i + 61)] = ((byte) this.boot_code[i]);
				}
			} else {
				arrayOfByte1[36] = ((byte) (int) ((this.fat32_fat_size_sector & 0xFF000000) >> 24));
				arrayOfByte1[37] = ((byte) (int) ((this.fat32_fat_size_sector & 0xFF0000) >> 16));
				arrayOfByte1[38] = ((byte) (int) ((this.fat32_fat_size_sector & 0xFF00) >> 8));
				arrayOfByte1[39] = ((byte) (int) (this.fat32_fat_size_sector & 0xFF));
				arrayOfByte1[40] = ((byte) this.fat32_flag);
				arrayOfByte1[41] = ((byte) this.fat32_flag);
				arrayOfByte1[42] = ((byte) this.fat32_version);
				arrayOfByte1[43] = ((byte) this.fat32_version);
				arrayOfByte1[44] = ((byte) (int) ((this.fat32_root_start_cluster & 0xFF000000) >> 24));
				arrayOfByte1[45] = ((byte) (int) ((this.fat32_root_start_cluster & 0xFF0000) >> 16));
				arrayOfByte1[46] = ((byte) (int) ((this.fat32_root_start_cluster & 0xFF00) >> 8));
				arrayOfByte1[47] = ((byte) (int) (this.fat32_root_start_cluster & 0xFF));
				arrayOfByte1[48] = ((byte) ((this.fat32_fsinfo_addr & 0xFF00) >> 8));
				arrayOfByte1[49] = ((byte) (this.fat32_fsinfo_addr & 0xFF));
				arrayOfByte1[50] = ((byte) ((this.fat32_backup_fsinfo_addr & 0xFF00) >> 8));
				arrayOfByte1[51] = ((byte) (this.fat32_backup_fsinfo_addr & 0xFF));
				for (int i = 0; i < this.fat32_reserved.length; i++)
					arrayOfByte1[(i + 52)] = this.fat32_reserved[i];
				arrayOfByte1[64] = ((byte) this.drive_number);
				arrayOfByte1[65] = ((byte) this.current_head);
				arrayOfByte1[66] = ((byte) this.boot_signature);
				arrayOfByte1[67] = ((byte) (int) ((this.volume_id & 0xFF000000) >> 24));
				arrayOfByte1[68] = ((byte) (int) ((this.volume_id & 0xFF0000) >> 16));
				arrayOfByte1[69] = ((byte) (int) ((this.volume_id & 0xFF00) >> 8));
				arrayOfByte1[70] = ((byte) (int) (this.volume_id & 0xFF));
				for (int i = 0; i < this.volume_label.length; i++)
					arrayOfByte1[(i + 71)] = ((byte) this.volume_label[i]);
				for (int i = 0; i < this.fs_type.length; i++)
					arrayOfByte1[(i + 82)] = ((byte) this.fs_type[i]);
				for (int i = 0; i < this.boot_code.length; i++) {
					arrayOfByte1[(i + 90)] = ((byte) this.boot_code[i]);
				}
			}
			arrayOfByte1['Ǿ'] = ((byte) ((this.boot_sector_signature & 0xFF00) >> 8));
			arrayOfByte1['ǿ'] = ((byte) (this.boot_sector_signature & 0xFF));

			localByteBuffer = ByteBuffer.wrap(arrayOfByte1);
			this.ImgChannel.position(0L);
			this.ImgChannel.write(localByteBuffer);

			getBootSectorInfo(0);
			fillFATtag();
			this.g_fat_index = 2L;

			if (!this.using_fat16) {
				byte[] arrayOfByte2 = new byte[BOOT_SECTOR_SIZE];

				arrayOfByte2[0] = 82;
				arrayOfByte2[1] = 82;
				arrayOfByte2[2] = 97;
				arrayOfByte2[3] = 65;
				for (int j = 0; j < 480; j++) {
					arrayOfByte2[(j + 4)] = 0;
				}
				arrayOfByte2['Ǥ'] = 114;
				arrayOfByte2['ǥ'] = 114;
				arrayOfByte2['Ǧ'] = 65;
				arrayOfByte2['ǧ'] = 97;

				arrayOfByte2['Ǩ'] = -1;
				arrayOfByte2['ǩ'] = -1;
				arrayOfByte2['Ǫ'] = -1;
				arrayOfByte2['ǫ'] = -1;

				arrayOfByte2['Ǭ'] = ((byte) (int) (this.g_fat_index & 0xFF));
				arrayOfByte2['ǭ'] = ((byte) (int) ((this.g_fat_index & 0xFF00) >> 8));
				arrayOfByte2['Ǯ'] = ((byte) (int) ((this.g_fat_index & 0xFF0000) >> 16));
				arrayOfByte2['ǯ'] = ((byte) (int) ((this.g_fat_index & 0xFF000000) >> 24));

				for (int j = 0; j < 14; j++) {
					arrayOfByte2[(j + 496)] = 0;
				}
				arrayOfByte2['Ǿ'] = 85;
				arrayOfByte2['ǿ'] = -86;

				localByteBuffer = ByteBuffer.wrap(arrayOfByte2);
				this.ImgChannel.position(512L);
				this.ImgChannel.write(localByteBuffer);

				this.pImg.seek(1534L);
				this.pImg.writeByte(85);
				this.pImg.writeByte(170);

				localByteBuffer = ByteBuffer.wrap(arrayOfByte1);
				this.ImgChannel.position(3072L);
				this.ImgChannel.write(localByteBuffer);

				localByteBuffer = ByteBuffer.wrap(arrayOfByte2);
				this.ImgChannel.position(3584L);
				this.ImgChannel.write(localByteBuffer);

				this.pImg.seek(4606L);
				this.pImg.writeByte(85);
				this.pImg.writeByte(170);
			}
		} catch (Exception localException2) {
			localException2.printStackTrace();
		}
	}

	public void closeChannel() {
		try {
			if (this.fileChannel != null) {
				this.fileChannel.close();
				this.fileChannel = null;
			}
			if (this.fileRaf != null) {
				this.fileRaf.close();
				this.fileRaf = null;
			}

			if (this.ImgChannel != null) {
				this.ImgChannel.close();
				this.ImgChannel = null;
			}
			if (this.pImg != null) {
				this.pImg.close();
				this.pImg = null;
			}
		} catch (Exception localException) {
			localException.printStackTrace();
		}
	}

	public void fillFATtag() {
		try {
			if (this.using_fat16) {
				this.pImg.seek(this.fat_start_addr);

				this.pImg.writeInt(-117440513);

				this.pImg.seek(this.fat_start_addr + this.fat_size_sector * this.sector_size);
				this.pImg.writeInt(-117440513);
			} else {
				this.pImg.seek(this.fat_start_addr);
				this.pImg.writeInt(-117440753);
				this.pImg.writeInt(-1);
				this.pImg.writeInt(65295);

				this.pImg.seek(this.fat32_fat2_addr);
				this.pImg.writeInt(-117440753);
				this.pImg.writeInt(-1);
				this.pImg.writeInt(65295);
			}
		} catch (Exception localException) {
			localException.printStackTrace();
		}
	}

	public long calculateFATTableSize() {
		int i = 512;
		long l1 = 0L;
		long l2 = 0L;
		try {
			l1 = (this.pImg.length() + this.number_of_fat * FAT_RECORD_SIZE * 2)
					/ (this.sectors_per_cluster * i + FAT_RECORD_SIZE * 2);

			l2 = (l1 + 2L) * FAT_RECORD_SIZE / i;
		} catch (IOException localIOException) {
			System.out.println(localIOException);
		}
		return l2;
	}

	public void getBootSectorInfo(int paramInt) {
		try {
			this.pImg.seek(BOOT_SECTOR_SIZE * paramInt);
			for (int i = 0; i < 3; i++) {
				this.jmp[i] = this.pImg.readUnsignedByte();
			}
			for (int i = 0; i < 8; i++) {
				this.oem[i] = ((char) this.pImg.readUnsignedByte());
			}

			this.sector_size = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
			this.sectors_per_cluster = this.pImg.readUnsignedByte();
			this.reserved_sector = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
			this.number_of_fat = this.pImg.readUnsignedByte();
			this.root_dir_entry = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
			this.total_block = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
			this.media_descriptor = this.pImg.readUnsignedByte();
			this.fat_size_sector = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
			this.sector_per_track = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
			this.number_of_head = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
			this.hidden_sector = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);
			this.total_sector_long = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);

			if (this.total_sector_long * this.sector_size / 1000L / 1024L / 1024L <= 2L) {
				this.using_fat16 = true;
				FAT_RESERVED_RECORD_NUM = 2;
				FAT_RECORD_SIZE = 2;
				this.boot_code = new char['ǀ'];
			} else {
				this.using_fat16 = false;
				FAT_RESERVED_RECORD_NUM = 3;
				FAT_RECORD_SIZE = 4;
				this.boot_code = new char['Ƥ'];
			}

			if (!this.using_fat16) {
				this.fat32_fat_size_sector = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);
				this.fat32_flag = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
				this.fat32_version = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
				this.fat32_root_start_cluster = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);
				this.fat32_fsinfo_addr = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
				this.fat32_backup_fsinfo_addr = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2,
						LITTLE_ENDIAN_TYPE);
				for (int i = 0; i < this.fat32_reserved.length; i++)
					this.fat32_reserved[i] = 0;
			}
			this.drive_number = this.pImg.readUnsignedByte();
			this.current_head = this.pImg.readUnsignedByte();
			this.boot_signature = this.pImg.readUnsignedByte();
			this.volume_id = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);

			for (int i = 0; i < 10; i++) {
				this.volume_label[i] = ((char) this.pImg.readUnsignedByte());
			}

			for (int i = 0; i < 8; i++) {
				this.fs_type[i] = ((char) this.pImg.readUnsignedByte());
			}
			for (int i = 0; i < this.boot_code.length; i++) {
				this.boot_code[i] = ((char) this.pImg.readUnsignedByte());
			}

			this.boot_sector_signature = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);

			this.fat_start_addr = (BOOT_SECTOR_SIZE * paramInt + this.reserved_sector * this.sector_size);
			if (this.using_fat16) {
				this.root_start_addr = (this.fat_start_addr
						+ this.fat_size_sector * this.number_of_fat * this.sector_size);
				this.data_start_addr = (this.root_start_addr + this.root_dir_entry * ROOT_DIR_ENTRY_SIZE);
			} else {
				this.fat32_fsinfo1_addr = 1000L;
				this.fat32_fsinfo2_addr = (this.fat32_fsinfo1_addr + 3072L);
				this.fat32_fat2_addr = (this.fat_start_addr + this.fat32_fat_size_sector * this.sector_size);

				this.root_start_addr = (this.fat_start_addr
						+ this.fat32_fat_size_sector * this.number_of_fat * this.sector_size);
				this.data_start_addr = (this.root_start_addr + this.sectors_per_cluster * this.sector_size);
				this.fat32_free_cluster = ((this.total_sector_long * this.sector_size - this.root_start_addr)
						/ (this.sectors_per_cluster * this.sector_size));
			}
		} catch (IOException localIOException) {
			System.out.println(localIOException);
		}
	}

	public void folderSizeCalculate() {
		long l1 = 0L;
		long l2 = this.fat_start_addr + FAT_RESERVED_RECORD_NUM * FAT_RECORD_SIZE;
		long l3 = 0L;
		long l4 = 0L;

		if (this.using_fat16) {
			l4 = this.fat_size_sector * this.sector_size / FAT_RECORD_SIZE;
		} else {
			l4 = this.fat32_fat_size_sector * this.sector_size / FAT_RECORD_SIZE;
		}
		try {
			this.pImg.seek(l2);
			do {
				if (this.using_fat16) {
					l1 = (short) ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
				} else {
					l1 = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);
				}
				if (l1 != 0L) {
					l3 += 1L;
				}
				l4 -= 1L;
			} while (l4 > 0L);

			this.folder_size = (l3 * (this.sectors_per_cluster * this.sector_size));

		} catch (IOException localIOException) {
			localIOException.printStackTrace();
		}
	}

	public static int ChangeToLittleEndian(int paramInt1, int paramInt2, int paramInt3) {
		int i = 0;

		byte[] arrayOfByte = new byte[paramInt2];
		ByteBuffer localByteBuffer = ByteBuffer.wrap(arrayOfByte);
		if (paramInt3 == LITTLE_ENDIAN_TYPE) {
			localByteBuffer.order(ByteOrder.LITTLE_ENDIAN);
		} else {
			localByteBuffer.order(ByteOrder.BIG_ENDIAN);
		}
		if (paramInt2 == 4) {
			localByteBuffer.putInt(paramInt1);
		} else if (paramInt2 == 2) {
			localByteBuffer.putShort((short) paramInt1);
		}
		for (int j = paramInt2 - 1; j > -1; j--) {
			i += ((arrayOfByte[j] & 0xFF) << 8 * (paramInt2 - 1 - j));
		}

		return i;
	}

	public String getLFNName(long paramLong, int paramInt1, long[] paramArrayOfLong, int paramInt2) {
		char[] arrayOfChar1 = new char[0];
		for (;;) {
			LFN localLFN = new LFN();

			if ((paramInt2 != NON_MULTI_CLUSTER) && (paramInt1 < 0)) {

				if (paramInt2 != 0) {
					paramInt1 = this.sectors_per_cluster * this.sector_size / ROOT_DIR_ENTRY_SIZE - 1;
					paramLong = this.data_start_addr + (paramArrayOfLong[(paramInt2 - 1)] - FAT_RESERVED_RECORD_NUM)
							* (this.sector_size * this.sectors_per_cluster);
				}
			}

			char[] arrayOfChar2 = localLFN.getLFNpackage(this.pImg, paramLong + ROOT_DIR_ENTRY_SIZE * paramInt1,
					localLFN);
			int i = arrayOfChar1.length + arrayOfChar2.length;
			char[] arrayOfChar3 = new char[arrayOfChar1.length];

			System.arraycopy(arrayOfChar1, 0, arrayOfChar3, 0, arrayOfChar3.length);
			arrayOfChar1 = new char[i];
			System.arraycopy(arrayOfChar3, 0, arrayOfChar1, 0, arrayOfChar3.length);
			System.arraycopy(arrayOfChar2, 0, arrayOfChar1, arrayOfChar3.length, arrayOfChar2.length);

			if ((localLFN.sequence & 0x40) == 64) {
				break;
			}
			paramInt1--;
		}

		return String.valueOf(arrayOfChar1);
	}

	public String getNameFromImg(RootDirectory paramRootDirectory, long paramLong, int paramInt1,
			long[] paramArrayOfLong, int paramInt2) {
		boolean bool = false;
		Object localObject = null;
		byte b = LFN.LFN_checksum(paramRootDirectory);

		if (paramInt2 == NON_MULTI_CLUSTER) {
			bool = LFN.LFNCheck(this.pImg, paramLong + ROOT_DIR_ENTRY_SIZE * (paramInt1 - 1), b);

		} else if (paramInt1 - 1 < 0) {
			if (paramInt2 != 0) {

				long l = this.data_start_addr + (paramArrayOfLong[(paramInt2 - 1)] - FAT_RESERVED_RECORD_NUM)
						* (this.sector_size * this.sectors_per_cluster);

				int i = this.sectors_per_cluster * this.sector_size / ROOT_DIR_ENTRY_SIZE - 1;
				bool = LFN.LFNCheck(this.pImg, l + ROOT_DIR_ENTRY_SIZE * i, b);
			}
		} else {
			bool = LFN.LFNCheck(this.pImg, paramLong + ROOT_DIR_ENTRY_SIZE * (paramInt1 - 1), b);
		}

		if (bool) {
			localObject = getLFNName(paramLong, paramInt1 - 1, paramArrayOfLong, paramInt2);

		} else {

			String str1 = null;
			String str2 = null;
			char[] arrayOfChar1 = new char[0];
			char[] arrayOfChar2 = new char[0];

			for (int j = 0; j < paramRootDirectory.filename.length; j++) {
				if (paramRootDirectory.filename[j] != 32)
					arrayOfChar1 = LFN.extend(arrayOfChar1, (char) paramRootDirectory.filename[j]);
			}
			str1 = String.valueOf(arrayOfChar1);

			if ((paramRootDirectory.upper == 24) || (paramRootDirectory.upper == 8)) {
				str1 = str1.toLowerCase();
			}

			for (int j = 0; j < paramRootDirectory.ext.length; j++) {
				if (paramRootDirectory.ext[j] != 32) {
					arrayOfChar2 = LFN.extend(arrayOfChar2, (char) paramRootDirectory.ext[j]);
				}
			}
			str2 = String.valueOf(arrayOfChar2);
			if ((paramRootDirectory.upper == 24) || (paramRootDirectory.upper == 16)) {
				str2 = str2.toLowerCase();
			}
			if ((str2 != null) && (str2.length() > 0)) {
				localObject = str1 + "." + str2;
			} else {
				localObject = str1;
			}
		}
		return (String) localObject;
	}

	public int listFilesFromImage(long paramLong, String paramString, long[] paramArrayOfLong, int paramInt) {
		int i = 0;
		int j = 0;
		long[] arrayOfLong = new long[0];

		if (this.using_fat16) {
			if (paramLong == this.root_start_addr) {
				j = this.root_dir_entry;
			} else {
				j = this.sectors_per_cluster * this.sector_size / ROOT_DIR_ENTRY_SIZE;
			}
		} else {
			j = this.sectors_per_cluster * this.sector_size / ROOT_DIR_ENTRY_SIZE;
		}
		for (int k = 0; k < j; k++) {
			if (this.user_stop_flag) {
				break;
			}
			RootDirectory localRootDirectory = new RootDirectory();
			long l1 = 0L;
			long l2 = 0L;
			long l3 = 0L;

			String str1 = null;
			int m = 0;
			int n = 0;

			l1 = paramLong + (ROOT_DIR_ENTRY_SIZE * k & UNSIGNED_INT_MASK);
			localRootDirectory.readFileRootDirectory(this.pImg, l1);

			if ((localRootDirectory.filename[0] != 0) && (localRootDirectory.attributes != 15)) {
				if ((byte) (localRootDirectory.filename[0] & UNSIGNED_BYTE_MASK) != -27) {

					str1 = getNameFromImg(localRootDirectory, paramLong, k, paramArrayOfLong, paramInt);
					l2 = getUTCTimeInMillisecond(localRootDirectory.create_date, localRootDirectory.create_time);
					l3 = getUTCTimeInMillisecond(localRootDirectory.modify_date, localRootDirectory.modify_time);
					if (str1 == null) {
						System.out.println("Got some wired error - listFilesFromImage()");
						return -1;
					}

					if ((localRootDirectory.attributes == FILE_ATTRI_SUBFOLDER)
							|| (localRootDirectory.attributes == (FILE_ATTRI_SUBFOLDER | FILE_ATTRI_HIDDEN))
							|| (localRootDirectory.attributes == (FILE_ATTRI_SUBFOLDER | FILE_ATTRI_FILE))) {

						if ((!str1.equals(".")) && (!str1.equals(".."))) {

							folderExistCheck(paramString, str1);

							arrayOfLong = mulit_cluster(localRootDirectory);
							if (arrayOfLong[0] != 0L) {

								for (int i1 = 0; i1 < arrayOfLong.length; i1++) {
									if (arrayOfLong.length > 1) {
										listFilesFromImage(
												this.data_start_addr + (arrayOfLong[i1] - FAT_RESERVED_RECORD_NUM)
														* this.sectors_per_cluster * this.sector_size,
												paramString + str1 + File.separatorChar, arrayOfLong, i1);

									} else {
										listFilesFromImage(
												this.data_start_addr + (arrayOfLong[i1] - FAT_RESERVED_RECORD_NUM)
														* this.sectors_per_cluster * this.sector_size,
												paramString + str1 + File.separatorChar, arrayOfLong,
												NON_MULTI_CLUSTER);
									}
								}
							}
						}
					} else if ((localRootDirectory.attributes == FILE_ATTRI_FILE)
							|| (localRootDirectory.attributes == FILE_ATTRI_FILE + FILE_ATTRI_HIDDEN)) {

						String str2 = paramString + str1;
						File localFile = new File(str2);
						int i2 = 0;

						for (int i3 = 0; i3 < this.FileList_array.length; i3++) {
							if (str2.equals(this.FileList_array[i3].path)) {
								this.FileList_array[i3].ischeck = true;
								break;
							}
						}

						if (!localFile.exists()) {
							i2 = 1;
						}
						if ((this.image_create_time < l3) || (this.image_create_time < l2)) {
							writeFileIntoDisk(paramString, str1, localRootDirectory);
						} else if (i2 != 0) {
							writeFileIntoDisk(paramString, str1, localRootDirectory);
						}

						if (this.user_stop_flag) {
							break;
						}
						this.copyed_size += localRootDirectory.file_size;

						if ((int) (this.copyed_size * 100.0D / this.folder_size) <= 95) {
							this.complete_percent = ((int) (this.copyed_size * 100.0D / this.folder_size));
						} else {
							this.complete_percent = 95;
						}
					}
				}
			}
		}

		return 0;
	}

	public void delFileCheck() {
		this.complete_percent = 98;

		for (int i = 0; i < this.FileList_array.length; i++) {
			if (!this.FileList_array[i].ischeck) {
				File localFile = new File(this.FileList_array[i].path);
				deleteAll(localFile);
			}
		}
		this.complete_percent = 100;
	}

	public void deleteAll(File paramFile) {
		if (!paramFile.exists()) {
			return;
		}
		if (paramFile.isFile()) {
			paramFile.delete();
			return;
		}

		File[] arrayOfFile = paramFile.listFiles();
		for (int i = 0; i < arrayOfFile.length; i++) {
			deleteAll(arrayOfFile[i]);
		}
		paramFile.delete();
	}

	public FileList[] listFolder(File paramFile, FileList[] paramArrayOfFileList) {
		if (paramFile == null) {
			return paramArrayOfFileList;
		}
		for (File localFile : paramFile.listFiles()) {
			FileList localFileList = new FileList();
			localFileList.filename = localFile.getName();
			localFileList.path = localFile.getPath();

			if (localFile.isDirectory()) {
				localFileList.isfolder = true;
				paramArrayOfFileList = extendFileList(paramArrayOfFileList, localFileList);
				paramArrayOfFileList = listFolder(localFile, paramArrayOfFileList);
			} else {
				paramArrayOfFileList = extendFileList(paramArrayOfFileList, localFileList);
			}
		}
		return paramArrayOfFileList;
	}

	public FileList[] extendFileList(FileList[] paramArrayOfFileList, FileList paramFileList) {
		int i = paramArrayOfFileList.length;
		FileList[] arrayOfFileList = new FileList[i + 1];
		System.arraycopy(paramArrayOfFileList, 0, arrayOfFileList, 0, i);
		arrayOfFileList[i] = paramFileList;

		return arrayOfFileList;
	}

	public void getFileList(String paramString) {
		this.FileList_array = new FileList[0];
		this.FileListCreatTime = System.currentTimeMillis();
		File localFile = new File(paramString);

		this.FileList_array = listFolder(localFile, this.FileList_array);

		try {
			Thread.sleep(1000L);
		} catch (InterruptedException localInterruptedException) {
			localInterruptedException.printStackTrace();
		}
	}

	public long[] mulit_cluster(RootDirectory paramRootDirectory) {
		long l1 = 0L;
		long l2 = 0L;
		long[] arrayOfLong = new long[1];
		long l3 = 0L;

		if (this.using_fat16) {
			arrayOfLong[0] = paramRootDirectory.start_cluster;
			l1 = paramRootDirectory.start_cluster;
		} else {
			l1 = paramRootDirectory.start_cluster | paramRootDirectory.fat32_reserved << 16;
			arrayOfLong[0] = l1;
		}

		if (l1 == 0L) {
			return arrayOfLong;
		}
		try {
			for (;;) {
				l3 = this.data_start_addr
						+ (l1 - FAT_RESERVED_RECORD_NUM) * (this.sector_size * this.sectors_per_cluster);

				l2 = (l3 - this.data_start_addr) / (this.sector_size * this.sectors_per_cluster)
						+ FAT_RESERVED_RECORD_NUM;

				this.pImg.seek(this.fat_start_addr + l2 * FAT_RECORD_SIZE);
				if (this.using_fat16) {
					l1 = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
					if (l1 == 65535L)
						break;
					arrayOfLong = extendLong(arrayOfLong, l1);

				} else {
					l1 = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);
					if (l1 == 268435455L)
						break;
					arrayOfLong = extendLong(arrayOfLong, l1);
				}

			}
		} catch (IOException localIOException) {
			localIOException.printStackTrace();
		}

		return arrayOfLong;
	}

	public long[] extendLong(long[] paramArrayOfLong, long paramLong) {
		int i = paramArrayOfLong.length;
		long[] arrayOfLong = new long[i + 1];
		System.arraycopy(paramArrayOfLong, 0, arrayOfLong, 0, i);
		arrayOfLong[i] = paramLong;

		return arrayOfLong;
	}

	public void folderExistCheck(String paramString1, String paramString2) {
		String str = new String(paramString1 + paramString2);
		File localFile = new File(str);

		if (!localFile.exists()) {
			localFile.mkdirs();
		} else {
			for (int i = 0; i < this.FileList_array.length; i++) {
				if (str.equals(this.FileList_array[i].path)) {
					this.FileList_array[i].ischeck = true;
					break;
				}
			}
		}
	}

	private void writeFileIntoDisk(String paramString1, String paramString2, RootDirectory paramRootDirectory) {
		String str = new String(paramString1 + paramString2);

		if (this.ImgChannel == null) {
			this.ImgChannel = this.pImg.getChannel();
		}
		long l1 = 0L;
		long l2 = this.sector_size * this.sectors_per_cluster;
		long l3 = paramRootDirectory.file_size;
		long l4 = this.sector_size * this.sectors_per_cluster;
		long l5 = l4;
		long l6 = 0L;
		long l7 = 0L;
		long l8 = 0L;

		try {
			File localFile = new File(str);
			if ((localFile.exists()) && (!localFile.delete())) {
			}

			if (!this.using_fat16) {
//				break label150;
			}else{
				l6 = paramRootDirectory.start_cluster;
				l8 = 65535L;
				return;
			}
		} catch (Exception localException) {
			localException.printStackTrace();
		}

//		l6 = paramRootDirectory.start_cluster;
//		l8 = 65535L;
//		break label169;
//		label150: l6 = paramRootDirectory.start_cluster | paramRootDirectory.fat32_reserved << 16;
		l8 = 268435455L;
		try {
			label169: this.fileRaf = new RandomAccessFile(str, "rw");
			this.fileChannel = this.fileRaf.getChannel();
			l7 = this.data_start_addr + l4 * (l6 - FAT_RESERVED_RECORD_NUM);
			this.ImgChannel.position(l7);
			while (((l3 > 0L ? 1 : 0) & (l6 != l8 ? 1 : 0)) != 0) {
				if (this.user_stop_flag) {
					break;
				}
				l2 = this.sector_size * this.sectors_per_cluster;

				if (l2 > l3)
					l2 = l3;
				if (l2 > l5) {
					l2 = l5;
				}
				ByteBuffer localByteBuffer = ByteBuffer.allocate((int) l2);
				localByteBuffer.clear();
				l1 = this.ImgChannel.read(localByteBuffer);
				localByteBuffer.flip();
				this.fileChannel.write(localByteBuffer);

				l5 -= l1;
				l3 -= l1;
				if (l5 == 0L) {
					this.ImgChannel.position(this.fat_start_addr + l6 * FAT_RECORD_SIZE);
					if (this.using_fat16) {
						l6 = ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
					} else {
						l6 = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);
					}
					this.ImgChannel.position(this.data_start_addr + l4 * (l6 - FAT_RESERVED_RECORD_NUM));
					l5 = l4;
				}

				if (this.user_stop_flag) {
					break;
				}
			}
			this.fileChannel.force(true);

			this.fileChannel.close();
			this.fileChannel = null;
			this.fileRaf.close();
			this.fileRaf = null;
		} catch (IOException localIOException) {
			System.out.println(localIOException);
		}
	}

	public long find_free_cluster_from_fat() {
		long l1 = this.g_fat_index;
		long l2 = 0L;

		long l3 = 0L;
		byte[] arrayOfByte;
		if (this.using_fat16) {
			arrayOfByte = new byte[2];
			arrayOfByte[0] = -1;
			arrayOfByte[1] = -1;
		} else {
			arrayOfByte = new byte[4];
			arrayOfByte[0] = -1;
			arrayOfByte[1] = -1;
			arrayOfByte[2] = -1;
			arrayOfByte[3] = 15;
		}
		try {
			do {
				l3 = this.fat_start_addr + l1 * FAT_RECORD_SIZE;
				this.pImg.seek(l3);

				if (this.using_fat16) {
					l2 = (short) ChangeToLittleEndian(this.pImg.readUnsignedShort(), 2, LITTLE_ENDIAN_TYPE);
				} else {
					l2 = ChangeToLittleEndian(this.pImg.readInt(), 4, LITTLE_ENDIAN_TYPE);
				}
				if (l2 == 0L) {
					this.pImg.seek(l3);
					this.pImg.write(arrayOfByte);

					if (!this.using_fat16) {
						this.pImg.seek(this.fat32_fat2_addr + l1 * FAT_RECORD_SIZE);
						this.pImg.write(arrayOfByte);
					}
					this.g_fat_index = l1;
					break;
				}

				l1 += 1L;
			} while (l2 != 0L);
		} catch (IOException localIOException) {
			localIOException.printStackTrace();
		}
		return l1;
	}

	void fillDateTime(String paramString, RootDirectory paramRootDirectory) {
		Path localPath = Paths.get(paramString, new String[0]);
		try {
			BasicFileAttributes localBasicFileAttributes = Files.readAttributes(localPath, BasicFileAttributes.class,
					new java.nio.file.LinkOption[0]);

			setDateTime(paramRootDirectory, localBasicFileAttributes.lastAccessTime().toMillis(), 2);

			setDateTime(paramRootDirectory, localBasicFileAttributes.lastModifiedTime().toMillis(), 1);

			setDateTime(paramRootDirectory, localBasicFileAttributes.creationTime().toMillis(), 0);
		} catch (IOException localIOException) {
			localIOException.printStackTrace();
		}
	}

	public RandomAccessFile getImageFilePointer() {
		return this.pImg;
	}

	public int createImage(String paramString) {
		int i = 0;
		File localFile = new File(paramString);

		return scanFolder(localFile, this.root_start_addr, 0L);
	}

	public void setStopFlag() {
		this.user_stop_flag = true;
	}

	public int scanFolder(File paramFile, long paramLong1, long paramLong2)
   {
     int i = 0;
     
     if (paramFile == null)
     {
       return -1;
     }
     
     Object localObject;
     RootDirectory localRootDirectory1;
     if (paramLong1 != this.root_start_addr) {
       localObject = new RootDirectory();
       long l1 = 0L;
       ((RootDirectory)localObject).filename[0] = 46;
       ((RootDirectory)localObject).attributes = 16;
       ((RootDirectory)localObject).upper = 0;
       
       setDateTime((RootDirectory)localObject, this.image_create_time, 2);
       setDateTime((RootDirectory)localObject, this.image_create_time, 1);
       setDateTime((RootDirectory)localObject, this.image_create_time, 0);
       l1 = (paramLong1 - this.data_start_addr) / (this.sector_size * this.sectors_per_cluster) + FAT_RESERVED_RECORD_NUM;
       ((RootDirectory)localObject).start_cluster = (l1 & 0xFFFF);
       ((RootDirectory)localObject).fat32_reserved = ((l1 & 0xFFFF0000) >> 16);
       ((RootDirectory)localObject).file_size = 0;
       fillRootDirectory((RootDirectory)localObject, null, paramLong1);
       
       localRootDirectory1 = new RootDirectory();
       localRootDirectory1.filename[0] = 46;
       localRootDirectory1.filename[1] = 46;
       localRootDirectory1.attributes = 16;
       localRootDirectory1.upper = 0;
       
       setDateTime(localRootDirectory1, this.image_create_time, 2);
       setDateTime(localRootDirectory1, this.image_create_time, 1);
       setDateTime(localRootDirectory1, this.image_create_time, 0);
       if (paramLong2 != this.root_start_addr) {
         l1 = (paramLong2 - this.data_start_addr) / (this.sector_size * this.sectors_per_cluster) + FAT_RESERVED_RECORD_NUM;
       } else
         l1 = 0L;
       localRootDirectory1.start_cluster = (l1 & 0xFFFF);
       localRootDirectory1.fat32_reserved = ((l1 & 0xFFFF0000) >> 16);
       
       ((RootDirectory)localObject).file_size = 0;
       fillRootDirectory(localRootDirectory1, null, paramLong1);
     }
     
 
     for (File tianlin : paramFile.listFiles()) {
       if (this.user_stop_flag) {
         break;
       }
       
 
 
       Path localPath = Paths.get(tianlin.getPath(), new String[0]);
       if (!Files.isSymbolicLink(localPath))
       {
 
 
         RootDirectory localRootDirectory2 = new RootDirectory();
         
         String[] arrayOfString = tianlin.getName().toUpperCase().split("\\.");
         
         long l2 = tianlin.lastModified();
         boolean bool = false;
         long l3 = 0L;long l4 = 0L;
         
 
         bool = SFNCheck(tianlin, localRootDirectory2);
         int n; if (!bool) {
           int m = 0;n = 0;
           LFN localLFN = new LFN();
           byte b = 0;
           
 
           localRootDirectory2.upper = 0;
           n = localLFN.getLNFByteNum(tianlin.getName());
           m = localLFN.lfn_pack_num;
           localRootDirectory2.filename[0] = 95;
           localRootDirectory2.filename[1] = 126;
           localRootDirectory2.filename[2] = (this.lfn_sequence++);
           b = LFN.LFN_checksum(localRootDirectory2);
           l3 = fillLFNRootDirectory(localLFN.byte_in_filename, m, n, b, paramLong1);
           if (l3 < 0L) {
             i = (int)l3;
             return i;
           }
           if (l3 > 0L) {
             paramLong1 = l3;
           }
         } else {
           byte[] arrayOfByte1;
           if (tianlin.isDirectory())
           {
 
             arrayOfByte1 = setFileNameAndExt(tianlin.getName().toUpperCase());
             for (n = 0; n < arrayOfByte1.length; n++) {
               localRootDirectory2.filename[n] = arrayOfByte1[n];
             }
           } else if (arrayOfString.length == 1)
           {
             arrayOfByte1 = setFileNameAndExt(arrayOfString[0]);
             for (n = 0; n < arrayOfByte1.length; n++) {
               localRootDirectory2.filename[n] = arrayOfByte1[n];
             }
           } else if (arrayOfString.length == 2) {
             arrayOfByte1 = setFileNameAndExt(arrayOfString[0]);
             for (n = 0; n < arrayOfByte1.length; n++)
               localRootDirectory2.filename[n] = arrayOfByte1[n];
             byte[] arrayOfByte2 = setFileNameAndExt(arrayOfString[1]);
             for (int i1 = 0; i1 < arrayOfByte2.length; i1++) {
               localRootDirectory2.ext[i1] = arrayOfByte2[i1];
             }
           }
         }
         
         fillDateTime(tianlin.getPath(), localRootDirectory2);
         
 
         l4 = find_free_cluster_from_fat() & UNSIGNED_INT_MASK;
         if (this.using_fat16) {
           localRootDirectory2.start_cluster = l4;
         } else {
           localRootDirectory2.start_cluster = (l4 & 0xFFFF);
           localRootDirectory2.fat32_reserved = ((l4 & 0xFFFF0000) >> 16);
         }
         
         if (tianlin.isDirectory()) {
           localRootDirectory2.attributes = FILE_ATTRI_SUBFOLDER;
         }
         else {
           localRootDirectory2.attributes = FILE_ATTRI_FILE;
           localRootDirectory2.file_size = ((int)tianlin.length());
         }
         
         l3 = fillRootDirectory(localRootDirectory2, null, paramLong1);
         if (l3 < 0L) {
           i = (int)l3;
           return i;
         }
         if (l3 > 0L) {
           paramLong1 = l3;
         }
         if (tianlin.isDirectory()) {
           i = scanFolder(tianlin, this.data_start_addr + (l4 - FAT_RESERVED_RECORD_NUM) * (this.sector_size * this.sectors_per_cluster), paramLong1);
           if (i < 0) {
             return i;
           }
         } else {
           writeFileIntoImg(localRootDirectory2, tianlin);
           
           if (this.user_stop_flag) {
             break;
           }
           this.copyed_size += tianlin.length();
           this.complete_percent = ((int)(this.copyed_size * 100.0D / this.folder_size));
         }
       } }
     return i;
   }

	public void writeFileIntoImg(RootDirectory paramRootDirectory, File paramFile) {
		long l1 = this.sector_size * this.sectors_per_cluster;
		long l2 = paramRootDirectory.file_size;
		long l3 = l2;
		long l4 = l1;
		long l5 = l4;
		long l6 = 0L;
		long l7 = 0L;
		long l8 = 0L;
		long l9 = 0L;
		long l10 = 0L;
		long l11 = 0L;

		if (this.using_fat16) {
			l6 = l7 = paramRootDirectory.start_cluster;
		} else {
			l6 = l7 = paramRootDirectory.fat32_reserved << 16 | paramRootDirectory.start_cluster;
		}
		try {
			this.fileRaf = new RandomAccessFile(paramFile.getPath(), "rw");
			this.fileChannel = this.fileRaf.getChannel();

			l10 = this.data_start_addr + l4 * (l6 - FAT_RESERVED_RECORD_NUM);

			this.ImgChannel.position(l10);
			l9 = l10;

			while ((l3 > 0L) && (!this.user_stop_flag)) {

				l1 = this.sector_size * this.sectors_per_cluster;

				if (l1 > l3)
					l1 = l3;
				if (l1 > l5)
					l1 = l5;
				l11 = 0L;
				l11 = this.ImgChannel.transferFrom(this.fileChannel, l9, l1);

				l3 -= l11;
				l5 -= l11;

				if (l5 == 0L) {
					if (this.using_fat16) {
						l8 = find_free_cluster_from_fat() & UNSIGNED_SHORT_MASK;
					} else {
						l8 = find_free_cluster_from_fat() & UNSIGNED_INT_MASK;
					}

					this.pImg.seek(this.fat_start_addr + l6 * FAT_RECORD_SIZE);
					if (this.using_fat16) {
						this.pImg.writeShort(ChangeToLittleEndian((int) l8, FAT_RECORD_SIZE, LITTLE_ENDIAN_TYPE));
					} else {
						this.pImg.writeInt(ChangeToLittleEndian((int) l8, FAT_RECORD_SIZE, LITTLE_ENDIAN_TYPE));

						this.pImg.seek(this.fat32_fat2_addr + l6 * FAT_RECORD_SIZE);
						this.pImg.writeInt(ChangeToLittleEndian((int) l8, FAT_RECORD_SIZE, LITTLE_ENDIAN_TYPE));

						this.fat32_free_cluster -= 1L;
						this.pImg.seek(this.fat32_fsinfo1_addr);
						this.pImg.writeInt(ChangeToLittleEndian((int) this.fat32_free_cluster, 4, LITTLE_ENDIAN_TYPE));

						this.pImg.writeInt(ChangeToLittleEndian((int) (this.g_fat_index + 1L), 4, LITTLE_ENDIAN_TYPE));
					}

					l6 = l8;
					l9 = this.data_start_addr + l4 * (l6 - FAT_RESERVED_RECORD_NUM);

					l5 = l4;
				}

				if (this.user_stop_flag) {
					break;
				}
			}

			this.ImgChannel.force(true);

			this.fileChannel.close();
			this.fileChannel = null;
			this.fileRaf.close();
			this.fileRaf = null;
		} catch (Exception localException) {
			localException.printStackTrace();
		}
	}

	public byte[] expandByteArray(byte[] paramArrayOfByte, int paramInt) {
		if (paramInt <= paramArrayOfByte.length) {
			return paramArrayOfByte;
		}

		byte[] arrayOfByte = new byte[paramInt];
		System.arraycopy(paramArrayOfByte, 0, arrayOfByte, 0, paramArrayOfByte.length);
		return arrayOfByte;
	}

	public byte[] longToBytes(long paramLong) {
		ByteBuffer localByteBuffer = ByteBuffer.allocate(8);
		localByteBuffer.putLong(0, paramLong);
		return localByteBuffer.array();
	}

	public long fillLFNRootDirectory(byte[] paramArrayOfByte, int paramInt1, int paramInt2, byte paramByte,
			long paramLong) {
		int i = 0;
		i = paramArrayOfByte.length;
		long l = 0L;

		for (int j = paramInt1; j > 0; j--) {
			LFN localLFN = new LFN();
			localLFN.sequence = intToByte(j);
			localLFN.checksum = paramByte;

			int k = 0;
			for (int m = (j - 1) * LFN_CHAR_LEN_IN_BYTE; m < i; k++) {
				if (k < 10) {
					localLFN.name0_9[k] = paramArrayOfByte[m];
				} else if (k < 22) {
					localLFN.name10_21[(k - 10)] = paramArrayOfByte[m];
				} else if (k < 26) {
					localLFN.name22_25[(k - 22)] = paramArrayOfByte[m];
				}
				m++;
			}

			if (j == paramInt1) {
				LFN tmp150_148 = localLFN;
				tmp150_148.sequence = ((byte) (tmp150_148.sequence | 0x40));
				// TODO tianlin
//				for (tmp150_148 += 2; tmp150_148 < LFN_CHAR_LEN_IN_BYTE; tmp150_148++) {
//					if (tmp150_148 < 10) {
//						localLFN.name0_9[tmp150_148] = -1;
//					} else if (tmp150_148 < 22) {
//						localLFN.name10_21[(tmp150_148 - 10)] = -1;
//					} else {
//						localLFN.name22_25[(tmp150_148 - 22)] = -1;
//					}
//				}
			}

			i = (j - 1) * LFN_CHAR_LEN_IN_BYTE;
			l = fillRootDirectory(null, localLFN, paramLong);

			if (l < 0L)
				return l;
			if (l > 0L)
				paramLong = l;
		}
		return paramLong;
	}

	public long fillRootDirectory(RootDirectory paramRootDirectory, LFN paramLFN, long paramLong) {
		long l1 = 0L;
		try {
			int i = 0;
			int j = 0;
			this.pImg.seek(paramLong);
			byte[] arrayOfByte = new byte[ROOT_DIR_ENTRY_SIZE];

			if (this.using_fat16) {
				if (paramLong == this.root_start_addr) {
					j = this.root_dir_entry;
				} else {
					j = this.sectors_per_cluster * this.sector_size / ROOT_DIR_ENTRY_SIZE;
				}
			} else {
				j = this.sectors_per_cluster * this.sector_size / ROOT_DIR_ENTRY_SIZE;
			}

			for (i = 0; i < j; i++) {
				int k = (byte) this.pImg.readUnsignedByte();

				this.pImg.seek(this.pImg.getFilePointer() - 1L);
				if ((k == 0) || (k == 229)) {
					break;
				}

				this.pImg.seek(this.pImg.getFilePointer() + ROOT_DIR_ENTRY_SIZE);
			}

			if (i == j) {

				if ((this.using_fat16) && (paramLong == this.root_start_addr)) {
					System.out.println("root dir entry can not save too much file with FAT16, Please using FAT32");
					return -2L;
				}

				long l2 = 0L;
				long l3 = 0L;
				l2 = find_free_cluster_from_fat() & UNSIGNED_INT_MASK;

				l3 = (paramLong - this.data_start_addr) / (this.sector_size * this.sectors_per_cluster)
						+ FAT_RESERVED_RECORD_NUM;
				this.pImg.seek(this.fat_start_addr + l3 * FAT_RECORD_SIZE);

				if (this.using_fat16) {
					this.pImg.writeShort(ChangeToLittleEndian((int) l2, 2, LITTLE_ENDIAN_TYPE));
				} else {
					this.pImg.writeInt(ChangeToLittleEndian((int) l2, 4, LITTLE_ENDIAN_TYPE));

					this.pImg.seek(this.fat32_fat2_addr + l3 * FAT_RECORD_SIZE);
					this.pImg.writeInt(ChangeToLittleEndian((int) l2, 4, LITTLE_ENDIAN_TYPE));

					this.fat32_free_cluster -= 1L;
					this.pImg.seek(this.fat32_fsinfo1_addr);
					this.pImg.writeInt(ChangeToLittleEndian((int) this.fat32_free_cluster, 4, LITTLE_ENDIAN_TYPE));

					this.pImg.writeInt(ChangeToLittleEndian((int) (this.g_fat_index + 1L), 4, LITTLE_ENDIAN_TYPE));
				}

				l1 = this.data_start_addr
						+ (l2 - FAT_RESERVED_RECORD_NUM) * (this.sector_size * this.sectors_per_cluster);
				this.pImg.seek(l1);
			}

			int m;

			if (paramLFN == null) {
				for (m = 0; m < paramRootDirectory.filename.length; m++)
					arrayOfByte[m] = paramRootDirectory.filename[m];
				for (m = 0; m < paramRootDirectory.ext.length; m++)
					arrayOfByte[(m + 8)] = paramRootDirectory.ext[m];
				arrayOfByte[11] = paramRootDirectory.attributes;
				arrayOfByte[12] = paramRootDirectory.upper;
				arrayOfByte[13] = paramRootDirectory.create_millsec;
				arrayOfByte[14] = ((byte) (paramRootDirectory.create_time & 0xFF));
				arrayOfByte[15] = ((byte) ((paramRootDirectory.create_time & 0xFF00) >> 8));
				arrayOfByte[16] = ((byte) (paramRootDirectory.create_date & 0xFF));
				arrayOfByte[17] = ((byte) ((paramRootDirectory.create_date & 0xFF00) >> 8));
				arrayOfByte[18] = ((byte) (paramRootDirectory.access_date & 0xFF));
				arrayOfByte[19] = ((byte) ((paramRootDirectory.access_date & 0xFF00) >> 8));
				arrayOfByte[20] = ((byte) (int) (paramRootDirectory.fat32_reserved & 0xFF));
				arrayOfByte[21] = ((byte) (int) ((paramRootDirectory.fat32_reserved & 0xFF00) >> 8));
				arrayOfByte[22] = ((byte) (paramRootDirectory.modify_time & 0xFF));
				arrayOfByte[23] = ((byte) ((paramRootDirectory.modify_time & 0xFF00) >> 8));
				arrayOfByte[24] = ((byte) (paramRootDirectory.modify_date & 0xFF));
				arrayOfByte[25] = ((byte) ((paramRootDirectory.modify_date & 0xFF00) >> 8));
				arrayOfByte[26] = ((byte) (int) (paramRootDirectory.start_cluster & 0xFF));
				arrayOfByte[27] = ((byte) (int) ((paramRootDirectory.start_cluster & 0xFF00) >> 8));
				arrayOfByte[28] = ((byte) (paramRootDirectory.file_size & 0xFF));
				arrayOfByte[29] = ((byte) ((paramRootDirectory.file_size & 0xFF00) >> 8));
				arrayOfByte[30] = ((byte) ((paramRootDirectory.file_size & 0xFF0000) >> 16));
				arrayOfByte[31] = ((byte) ((paramRootDirectory.file_size & 0xFF000000) >> 24));
			} else {
				arrayOfByte[0] = paramLFN.sequence;
				for (m = 0; m < paramLFN.name0_9.length; m++)
					arrayOfByte[(m + 1)] = paramLFN.name0_9[m];
				arrayOfByte[11] = paramLFN.attribute;
				arrayOfByte[12] = paramLFN.type;
				arrayOfByte[13] = paramLFN.checksum;
				for (m = 0; m < paramLFN.name10_21.length; m++)
					arrayOfByte[(m + 14)] = paramLFN.name10_21[m];
				arrayOfByte[26] = 0;
				arrayOfByte[27] = 0;
				for (m = 0; m < paramLFN.name22_25.length; m++) {
					arrayOfByte[(m + 28)] = paramLFN.name22_25[m];
				}
			}
			ByteBuffer localByteBuffer = ByteBuffer.allocate(32);
			localByteBuffer.clear();
			localByteBuffer.put(arrayOfByte);
			localByteBuffer.flip();

			while (localByteBuffer.hasRemaining()) {
				this.ImgChannel.write(localByteBuffer);
			}
			this.ImgChannel.force(true);

		} catch (EOFException localEOFException) {
			localEOFException.printStackTrace();
		} catch (IOException localIOException) {
			localIOException.printStackTrace();
		}
		return l1;
	}

	public boolean SFNCheck(File paramFile, RootDirectory paramRootDirectory) {
		String str = paramFile.getName();
		String[] arrayOfString = str.split("\\.");
		Pattern localPattern1 = Pattern.compile("[_a-z0-9-[.]]*");
		Pattern localPattern2 = Pattern.compile("[_A-Z0-9-[.]]*");
		Pattern localPattern3 = Pattern.compile("[_a-z0-9-]*");
		Pattern localPattern4 = Pattern.compile("[_A-Z0-9-]*");
		Pattern localPattern5 = Pattern.compile("[_a-z0-9-]*");
		Pattern localPattern6 = Pattern.compile("[_A-Z0-9-]*");

		Matcher localMatcher1;
		Matcher localMatcher2;
		if (!paramFile.isDirectory()) {
			if (arrayOfString.length > 2) {
				return false;
			}

			if (arrayOfString.length == 1) {
				if (arrayOfString[0].length() > 8) {
					return false;
				}
				localMatcher1 = localPattern3.matcher(arrayOfString[0]);
				localMatcher2 = localPattern4.matcher(arrayOfString[0]);
				if (localMatcher1.matches()) {
					paramRootDirectory.upper = 24;
				} else if (localMatcher2.matches()) {
					paramRootDirectory.upper = 0;
				} else {
					return false;
				}
			} else if (arrayOfString.length == 2) {
				if ((arrayOfString[0].length() > 8) || (arrayOfString[1].length() > 3)) {
					return false;
				}

				localMatcher1 = localPattern3.matcher(arrayOfString[0]);
				localMatcher2 = localPattern4.matcher(arrayOfString[0]);
				Matcher localMatcher3 = localPattern5.matcher(arrayOfString[1]);
				Matcher localMatcher4 = localPattern6.matcher(arrayOfString[1]);

				if ((localMatcher1.matches()) && (localMatcher3.matches())) {
					paramRootDirectory.upper = 24;
				} else if ((localMatcher2.matches()) && (localMatcher4.matches())) {
					paramRootDirectory.upper = 0;
				} else if ((localMatcher2.matches()) && (localMatcher3.matches())) {
					paramRootDirectory.upper = 16;
				} else if ((localMatcher1.matches()) && (localMatcher4.matches())) {
					paramRootDirectory.upper = 8;
				} else {
					return false;
				}
			}
		} else {
			if (str.indexOf('.') > 0) {
				return false;
			}
			if (str.length() > 8) {
				return false;
			}

			localMatcher1 = localPattern3.matcher(str);
			localMatcher2 = localPattern4.matcher(str);
			if (localMatcher1.matches()) {
				paramRootDirectory.upper = 24;
			} else if (localMatcher2.matches()) {
				paramRootDirectory.upper = 0;
			} else {
				return false;
			}
		}
		return true;
	}

	public byte[] setFileNameAndExt(String paramString) {
		char[] arrayOfChar = paramString.toCharArray();
		ByteBuffer localByteBuffer = Charset.forName("UTF-8").encode(java.nio.CharBuffer.wrap(arrayOfChar));
		byte[] arrayOfByte = new byte[localByteBuffer.remaining()];
		localByteBuffer.get(arrayOfByte);

		return arrayOfByte;
	}

	public void setDateTime(RootDirectory paramRootDirectory, long paramLong, int paramInt) {
		int i2 = 0;
		int i3 = 0;

		SimpleDateFormat localSimpleDateFormat1 = new SimpleDateFormat("yyyy");
		SimpleDateFormat localSimpleDateFormat2 = new SimpleDateFormat("MM");
		SimpleDateFormat localSimpleDateFormat3 = new SimpleDateFormat("dd");
		SimpleDateFormat localSimpleDateFormat4 = new SimpleDateFormat("HH");
		SimpleDateFormat localSimpleDateFormat5 = new SimpleDateFormat("mm");
		SimpleDateFormat localSimpleDateFormat6 = new SimpleDateFormat("ss");

		int i = Integer.valueOf(localSimpleDateFormat1.format(Long.valueOf(paramLong))).intValue() - 1980;
		int j = Integer.valueOf(localSimpleDateFormat2.format(Long.valueOf(paramLong))).intValue();
		int k = Integer.valueOf(localSimpleDateFormat3.format(Long.valueOf(paramLong))).intValue();
		int m = Integer.valueOf(localSimpleDateFormat4.format(Long.valueOf(paramLong))).intValue();
		int n = Integer.valueOf(localSimpleDateFormat5.format(Long.valueOf(paramLong))).intValue();
		int i1 = Integer.valueOf(localSimpleDateFormat6.format(Long.valueOf(paramLong))).intValue();

		i2 = (short) (i2 | intToByte(i) << 9);
		i2 = (short) (i2 | intToByte(j) << 5);
		i2 = (short) (i2 | intToByte(k));

		i3 = (short) (i3 | intToByte(m) << 11);
		i3 = (short) (i3 | intToByte(n) << 5);
		i3 = (short) (i3 | intToByte(i1) >> 1);

		if (paramInt == 1) {
			paramRootDirectory.modify_date = (short) i2;
			paramRootDirectory.modify_time = (short) i3;
		} else if (paramInt == 0) {
			paramRootDirectory.create_date = (short) i2;
			paramRootDirectory.create_time = (short) i3;
			paramRootDirectory.create_millsec = 0;
		} else {
			paramRootDirectory.access_date = (short) i2;
		}
	}

	public long getUTCTimeInMillisecond(long paramLong1, long paramLong2) {
		long l7 = 0L;
		SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");

		long l1 = (paramLong1 >> 9) + 1980L;
		long l2 = paramLong1 >> 5 & 0xF;
		long l3 = paramLong1 & 0x1F;
		long l4 = paramLong2 >> 11 & 0x1F;
		long l5 = paramLong2 >> 5 & 0x3F;
		long l6 = (paramLong2 & 0x1F) * 2L;

		try {
			String str = String.valueOf(l1) + "/" + String.valueOf(l2) + "/" + String.valueOf(l3) + " "
					+ String.valueOf(l4) + ":" + String.valueOf(l5) + ":" + String.valueOf(l6);

			Date localDate = localSimpleDateFormat.parse(str);
			Calendar localCalendar = Calendar.getInstance();
			localCalendar.setTime(localDate);
			l7 = localCalendar.getTimeInMillis();
		} catch (ParseException localParseException) {
			localParseException.printStackTrace();
		}

		return l7;
	}

	public static long getFileFolderSize(File paramFile) {
		long l = 0L;

		Path localPath = null;
		localPath = Paths.get(paramFile.getPath(), new String[0]);

		if (Files.isSymbolicLink(localPath)) {
			return 0L;
		}

		if (paramFile.isDirectory()) {
			for (File localFile : paramFile.listFiles()) {
				localPath = Paths.get(localFile.getPath(), new String[0]);
				if (!Files.isSymbolicLink(localPath)) {

					if (localFile.isFile()) {
						l += localFile.length();
					} else
						l += getFileFolderSize(localFile);
				}
			}
		} else if (paramFile.isFile()) {
			l += paramFile.length();
		}
		return l;
	}

	public static byte intToByte(int paramInt) {
		byte[] arrayOfByte = new byte[4];
		arrayOfByte[0] = ((byte) ((paramInt & 0xFF000000) >> 24));
		arrayOfByte[1] = ((byte) ((paramInt & 0xFF0000) >> 16));
		arrayOfByte[2] = ((byte) ((paramInt & 0xFF00) >> 8));
		arrayOfByte[3] = ((byte) (paramInt & 0xFF));

		return arrayOfByte[3];
	}

	public static int ByteArray2Int(byte[] paramArrayOfByte) {
		int i = 0;
		for (int j = 3; j > -1; j--) {
			i += ((paramArrayOfByte[j] & UNSIGNED_BYTE_MASK) << 8 * (3 - j));
		}
		return i;
	}

	public void fat16_boot_code_init() {
		this.boot_code[0] = '3';
		this.boot_code[1] = 'É';
		this.boot_code[2] = '';
		this.boot_code[3] = 'Ñ';
		this.boot_code[4] = '¼';
		this.boot_code[5] = 'ð';
		this.boot_code[6] = '{';
		this.boot_code[7] = '';
		this.boot_code[8] = 'Ù';
		this.boot_code[9] = '¸';
		this.boot_code[10] = '\000';
		this.boot_code[11] = ' ';
		this.boot_code[12] = '';
		this.boot_code[13] = 'À';
		this.boot_code[14] = 'ü';
		this.boot_code[15] = '½';
		this.boot_code[16] = '\000';
		this.boot_code[17] = '|';
		this.boot_code[18] = '8';
		this.boot_code[19] = 'N';
		this.boot_code[20] = '$';
		this.boot_code[21] = '}';
		this.boot_code[22] = '$';
		this.boot_code[23] = '';
		this.boot_code[24] = 'Á';
		this.boot_code[25] = '';
		this.boot_code[26] = 'è';
		this.boot_code[27] = '<';
		this.boot_code[28] = '\001';
		this.boot_code[29] = 'r';
		this.boot_code[30] = '\034';
		this.boot_code[31] = '';
		this.boot_code[32] = 'ë';
		this.boot_code[33] = ':';
		this.boot_code[34] = 'f';
		this.boot_code[35] = '¡';
		this.boot_code[36] = '\034';
		this.boot_code[37] = '|';
		this.boot_code[38] = '&';
		this.boot_code[39] = 'f';
		this.boot_code[40] = ';';
		this.boot_code[41] = '\007';
		this.boot_code[42] = '&';
		this.boot_code[43] = '';
		this.boot_code[44] = 'W';
		this.boot_code[45] = 'ü';
		this.boot_code[46] = 'u';
		this.boot_code[47] = '\006';
		this.boot_code[48] = '';
		this.boot_code[49] = 'Ê';
		this.boot_code[50] = '\002';
		this.boot_code[51] = '';
		this.boot_code[52] = 'V';
		this.boot_code[53] = '\002';
		this.boot_code[54] = '';
		this.boot_code[55] = 'Ã';
		this.boot_code[56] = '\020';
		this.boot_code[57] = 's';
		this.boot_code[58] = 'ë';
		this.boot_code[59] = '3';
		this.boot_code[60] = 'É';
		this.boot_code[61] = '';
		this.boot_code[62] = 'F';
		this.boot_code[63] = '\020';
		this.boot_code[64] = '';
		this.boot_code[65] = '÷';
		this.boot_code[66] = 'f';
		this.boot_code[67] = '\026';
		this.boot_code[68] = '\003';
		this.boot_code[69] = 'F';
		this.boot_code[70] = '\034';
		this.boot_code[71] = '\023';
		this.boot_code[72] = 'V';
		this.boot_code[73] = '\036';
		this.boot_code[74] = '\003';
		this.boot_code[75] = 'F';
		this.boot_code[76] = '\016';
		this.boot_code[77] = '\023';
		this.boot_code[78] = 'Ñ';
		this.boot_code[79] = '';
		this.boot_code[80] = 'v';
		this.boot_code[81] = '\021';
		this.boot_code[82] = '`';
		this.boot_code[83] = '';
		this.boot_code[84] = 'F';
		this.boot_code[85] = 'ü';
		this.boot_code[86] = '';
		this.boot_code[87] = 'V';
		this.boot_code[88] = 'þ';
		this.boot_code[89] = '¸';
		this.boot_code[90] = ' ';
		this.boot_code[91] = '\000';
		this.boot_code[92] = '÷';
		this.boot_code[93] = 'æ';
		this.boot_code[94] = '';
		this.boot_code[95] = '^';
		this.boot_code[96] = '\013';
		this.boot_code[97] = '\003';
		this.boot_code[98] = 'Ã';
		this.boot_code[99] = 'H';
		this.boot_code[100] = '÷';
		this.boot_code[101] = 'ó';
		this.boot_code[102] = '\001';
		this.boot_code[103] = 'F';
		this.boot_code[104] = 'ü';
		this.boot_code[105] = '\021';
		this.boot_code[106] = 'N';
		this.boot_code[107] = 'þ';
		this.boot_code[108] = 'a';
		this.boot_code[109] = '¿';
		this.boot_code[110] = '\000';
		this.boot_code[111] = '\000';
		this.boot_code[112] = 'è';
		this.boot_code[113] = 'æ';
		this.boot_code[114] = '\000';
		this.boot_code[115] = 'r';
		this.boot_code[116] = '9';
		this.boot_code[117] = '&';
		this.boot_code[118] = '8';
		this.boot_code[119] = '-';
		this.boot_code[120] = 't';
		this.boot_code[121] = '\027';
		this.boot_code[122] = '`';
		this.boot_code[123] = '±';
		this.boot_code[124] = '\013';
		this.boot_code[125] = '¾';
		this.boot_code[126] = '¡';
		this.boot_code[127] = '}';
		this.boot_code[''] = 'ó';
		this.boot_code[''] = '¦';
		this.boot_code[''] = 'a';
		this.boot_code[''] = 't';
		this.boot_code[''] = '2';
		this.boot_code[''] = 'N';
		this.boot_code[''] = 't';
		this.boot_code[''] = '\t';
		this.boot_code[''] = '';
		this.boot_code[''] = 'Ç';
		this.boot_code[''] = ' ';
		this.boot_code[''] = ';';
		this.boot_code[''] = 'û';
		this.boot_code[''] = 'r';
		this.boot_code[''] = 'æ';
		this.boot_code[''] = 'ë';
		this.boot_code[''] = 'Ü';
		this.boot_code[''] = ' ';
		this.boot_code[''] = 'û';
		this.boot_code[''] = '}';
		this.boot_code[''] = '´';
		this.boot_code[''] = '}';
		this.boot_code[''] = '';
		this.boot_code[''] = 'ð';
		this.boot_code[''] = '¬';
		this.boot_code[''] = '';
		this.boot_code[''] = '@';
		this.boot_code[''] = 't';
		this.boot_code[''] = '\f';
		this.boot_code[''] = 'H';
		this.boot_code[''] = 't';
		this.boot_code[''] = '\023';
		this.boot_code[' '] = '´';
		this.boot_code['¡'] = '\016';
		this.boot_code['¢'] = '»';
		this.boot_code['£'] = '\007';
		this.boot_code['¤'] = '\000';
		this.boot_code['¥'] = 'Í';
		this.boot_code['¦'] = '\020';
		this.boot_code['§'] = 'ë';
		this.boot_code['¨'] = 'ï';
		this.boot_code['©'] = ' ';
		this.boot_code['ª'] = 'ý';
		this.boot_code['«'] = '}';
		this.boot_code['¬'] = 'ë';
		this.boot_code['­'] = 'æ';
		this.boot_code['®'] = ' ';
		this.boot_code['¯'] = 'ü';
		this.boot_code['°'] = '}';
		this.boot_code['±'] = 'ë';
		this.boot_code['²'] = 'á';
		this.boot_code['³'] = 'Í';
		this.boot_code['´'] = '\026';
		this.boot_code['µ'] = 'Í';
		this.boot_code['¶'] = '\031';
		this.boot_code['·'] = '&';
		this.boot_code['¸'] = '';
		this.boot_code['¹'] = 'U';
		this.boot_code['º'] = '\032';
		this.boot_code['»'] = 'R';
		this.boot_code['¼'] = '°';
		this.boot_code['½'] = '\001';
		this.boot_code['¾'] = '»';
		this.boot_code['¿'] = '\000';
		this.boot_code['À'] = '\000';
		this.boot_code['Á'] = 'è';
		this.boot_code['Â'] = ';';
		this.boot_code['Ã'] = '\000';
		this.boot_code['Ä'] = 'r';
		this.boot_code['Å'] = 'è';
		this.boot_code['Æ'] = '[';
		this.boot_code['Ç'] = '';
		this.boot_code['È'] = 'V';
		this.boot_code['É'] = '$';
		this.boot_code['Ê'] = '¾';
		this.boot_code['Ë'] = '\013';
		this.boot_code['Ì'] = '|';
		this.boot_code['Í'] = '';
		this.boot_code['Î'] = 'ü';
		this.boot_code['Ï'] = 'Ç';
		this.boot_code['Ð'] = 'F';
		this.boot_code['Ñ'] = 'ð';
		this.boot_code['Ò'] = '=';
		this.boot_code['Ó'] = '}';
		this.boot_code['Ô'] = 'Ç';
		this.boot_code['Õ'] = 'F';
		this.boot_code['Ö'] = 'ô';
		this.boot_code['×'] = ')';
		this.boot_code['Ø'] = '}';
		this.boot_code['Ù'] = '';
		this.boot_code['Ú'] = 'Ù';
		this.boot_code['Û'] = '';
		this.boot_code['Ü'] = 'N';
		this.boot_code['Ý'] = 'ò';
		this.boot_code['Þ'] = '';
		this.boot_code['ß'] = 'N';
		this.boot_code['à'] = 'ö';
		this.boot_code['á'] = 'Æ';
		this.boot_code['â'] = '\006';
		this.boot_code['ã'] = '';
		this.boot_code['ä'] = '}';
		this.boot_code['å'] = 'Ë';
		this.boot_code['æ'] = 'ê';
		this.boot_code['ç'] = '\003';
		this.boot_code['è'] = '\000';
		this.boot_code['é'] = '\000';
		this.boot_code['ê'] = ' ';
		this.boot_code['ë'] = '\017';
		this.boot_code['ì'] = '¶';
		this.boot_code['í'] = 'È';
		this.boot_code['î'] = 'f';
		this.boot_code['ï'] = '';
		this.boot_code['ð'] = 'F';
		this.boot_code['ñ'] = 'ø';
		this.boot_code['ò'] = 'f';
		this.boot_code['ó'] = '\003';
		this.boot_code['ô'] = 'F';
		this.boot_code['õ'] = '\034';
		this.boot_code['ö'] = 'f';
		this.boot_code['÷'] = '';
		this.boot_code['ø'] = 'Ð';
		this.boot_code['ù'] = 'f';
		this.boot_code['ú'] = 'Á';
		this.boot_code['û'] = 'ê';
		this.boot_code['ü'] = '\020';
		this.boot_code['ý'] = 'ë';
		this.boot_code['þ'] = '^';
		this.boot_code['ÿ'] = '\017';
		this.boot_code['Ā'] = '¶';
		this.boot_code['ā'] = 'È';
		this.boot_code['Ă'] = 'J';
		this.boot_code['ă'] = 'J';
		this.boot_code['Ą'] = '';
		this.boot_code['ą'] = 'F';
		this.boot_code['Ć'] = '\r';
		this.boot_code['ć'] = '2';
		this.boot_code['Ĉ'] = 'ä';
		this.boot_code['ĉ'] = '÷';
		this.boot_code['Ċ'] = 'â';
		this.boot_code['ċ'] = '\003';
		this.boot_code['Č'] = 'F';
		this.boot_code['č'] = 'ü';
		this.boot_code['Ď'] = '\023';
		this.boot_code['ď'] = 'V';
		this.boot_code['Đ'] = 'þ';
		this.boot_code['đ'] = 'ë';
		this.boot_code['Ē'] = 'J';
		this.boot_code['ē'] = 'R';
		this.boot_code['Ĕ'] = 'P';
		this.boot_code['ĕ'] = '\006';
		this.boot_code['Ė'] = 'S';
		this.boot_code['ė'] = 'j';
		this.boot_code['Ę'] = '\001';
		this.boot_code['ę'] = 'j';
		this.boot_code['Ě'] = '\020';
		this.boot_code['ě'] = '';
		this.boot_code['Ĝ'] = '';
		this.boot_code['ĝ'] = 'F';
		this.boot_code['Ğ'] = '\030';
		this.boot_code['ğ'] = '';
		this.boot_code['Ġ'] = '';
		this.boot_code['ġ'] = '3';
		this.boot_code['Ģ'] = 'Ò';
		this.boot_code['ģ'] = '÷';
		this.boot_code['Ĥ'] = 'ö';
		this.boot_code['ĥ'] = '';
		this.boot_code['Ħ'] = '÷';
		this.boot_code['ħ'] = 'ö';
		this.boot_code['Ĩ'] = 'B';
		this.boot_code['ĩ'] = '';
		this.boot_code['Ī'] = 'Ê';
		this.boot_code['ī'] = '÷';
		this.boot_code['Ĭ'] = 'v';
		this.boot_code['ĭ'] = '\032';
		this.boot_code['Į'] = '';
		this.boot_code['į'] = 'ò';
		this.boot_code['İ'] = '';
		this.boot_code['ı'] = 'è';
		this.boot_code['Ĳ'] = 'À';
		this.boot_code['ĳ'] = 'Ì';
		this.boot_code['Ĵ'] = '\002';
		this.boot_code['ĵ'] = '\n';
		this.boot_code['Ķ'] = 'Ì';
		this.boot_code['ķ'] = '¸';
		this.boot_code['ĸ'] = '\001';
		this.boot_code['Ĺ'] = '\002';
		this.boot_code['ĺ'] = '';
		this.boot_code['Ļ'] = '~';
		this.boot_code['ļ'] = '\002';
		this.boot_code['Ľ'] = '\016';
		this.boot_code['ľ'] = 'u';
		this.boot_code['Ŀ'] = '\004';
		this.boot_code['ŀ'] = '´';
		this.boot_code['Ł'] = 'B';
		this.boot_code['ł'] = '';
		this.boot_code['Ń'] = 'ô';
		this.boot_code['ń'] = '';
		this.boot_code['Ņ'] = 'V';
		this.boot_code['ņ'] = '$';
		this.boot_code['Ň'] = 'Í';
		this.boot_code['ň'] = '\023';
		this.boot_code['ŉ'] = 'a';
		this.boot_code['Ŋ'] = 'a';
		this.boot_code['ŋ'] = 'r';
		this.boot_code['Ō'] = '\013';
		this.boot_code['ō'] = '@';
		this.boot_code['Ŏ'] = 'u';
		this.boot_code['ŏ'] = '\001';
		this.boot_code['Ő'] = 'B';
		this.boot_code['ő'] = '\003';
		this.boot_code['Œ'] = '^';
		this.boot_code['œ'] = '\013';
		this.boot_code['Ŕ'] = 'I';
		this.boot_code['ŕ'] = 'u';
		this.boot_code['Ŗ'] = '\006';
		this.boot_code['ŗ'] = 'ø';
		this.boot_code['Ř'] = 'Ã';
		this.boot_code['ř'] = 'A';
		this.boot_code['Ś'] = '»';
		this.boot_code['ś'] = '\000';
		this.boot_code['Ŝ'] = '\000';
		this.boot_code['ŝ'] = '`';
		this.boot_code['Ş'] = 'f';
		this.boot_code['ş'] = 'j';
		this.boot_code['Š'] = '\000';
		this.boot_code['š'] = 'ë';
		this.boot_code['Ţ'] = '°';
		this.boot_code['ţ'] = 'B';
		this.boot_code['Ť'] = 'O';
		this.boot_code['ť'] = 'O';
		this.boot_code['Ŧ'] = 'T';
		this.boot_code['ŧ'] = 'M';
		this.boot_code['Ũ'] = 'G';
		this.boot_code['ũ'] = 'R';
		this.boot_code['Ū'] = ' ';
		this.boot_code['ū'] = ' ';
		this.boot_code['Ŭ'] = ' ';
		this.boot_code['ŭ'] = ' ';
		this.boot_code['Ů'] = '\r';
		this.boot_code['ů'] = '\n';
		this.boot_code['Ű'] = 'R';
		this.boot_code['ű'] = 'e';
		this.boot_code['Ų'] = 'm';
		this.boot_code['ų'] = 'o';
		this.boot_code['Ŵ'] = 'v';
		this.boot_code['ŵ'] = 'e';
		this.boot_code['Ŷ'] = ' ';
		this.boot_code['ŷ'] = 'd';
		this.boot_code['Ÿ'] = 'i';
		this.boot_code['Ź'] = 's';
		this.boot_code['ź'] = 'k';
		this.boot_code['Ż'] = 's';
		this.boot_code['ż'] = ' ';
		this.boot_code['Ž'] = 'o';
		this.boot_code['ž'] = 'r';
		this.boot_code['ſ'] = ' ';
		this.boot_code['ƀ'] = 'o';
		this.boot_code['Ɓ'] = 't';
		this.boot_code['Ƃ'] = 'h';
		this.boot_code['ƃ'] = 'e';
		this.boot_code['Ƅ'] = 'r';
		this.boot_code['ƅ'] = ' ';
		this.boot_code['Ɔ'] = 'm';
		this.boot_code['Ƈ'] = 'e';
		this.boot_code['ƈ'] = 'd';
		this.boot_code['Ɖ'] = 'i';
		this.boot_code['Ɗ'] = 'a';
		this.boot_code['Ƌ'] = '.';
		this.boot_code['ƌ'] = 'ÿ';
		this.boot_code['ƍ'] = '\r';
		this.boot_code['Ǝ'] = '\n';
		this.boot_code['Ə'] = 'D';
		this.boot_code['Ɛ'] = 'i';
		this.boot_code['Ƒ'] = 's';
		this.boot_code['ƒ'] = 'k';
		this.boot_code['Ɠ'] = ' ';
		this.boot_code['Ɣ'] = 'e';
		this.boot_code['ƕ'] = 'r';
		this.boot_code['Ɩ'] = 'r';
		this.boot_code['Ɨ'] = 'o';
		this.boot_code['Ƙ'] = 'r';
		this.boot_code['ƙ'] = 'ÿ';
		this.boot_code['ƚ'] = '\r';
		this.boot_code['ƛ'] = '\n';
		this.boot_code['Ɯ'] = 'P';
		this.boot_code['Ɲ'] = 'r';
		this.boot_code['ƞ'] = 'e';
		this.boot_code['Ɵ'] = 's';
		this.boot_code['Ơ'] = 's';
		this.boot_code['ơ'] = ' ';
		this.boot_code['Ƣ'] = 'a';
		this.boot_code['ƣ'] = 'n';
		this.boot_code['Ƥ'] = 'y';
		this.boot_code['ƥ'] = ' ';
		this.boot_code['Ʀ'] = 'k';
		this.boot_code['Ƨ'] = 'e';
		this.boot_code['ƨ'] = 'y';
		this.boot_code['Ʃ'] = ' ';
		this.boot_code['ƪ'] = 't';
		this.boot_code['ƫ'] = 'o';
		this.boot_code['Ƭ'] = ' ';
		this.boot_code['ƭ'] = 'r';
		this.boot_code['Ʈ'] = 'e';
		this.boot_code['Ư'] = 's';
		this.boot_code['ư'] = 't';
		this.boot_code['Ʊ'] = 'a';
		this.boot_code['Ʋ'] = 'r';
		this.boot_code['Ƴ'] = 't';
		this.boot_code['ƴ'] = '\r';
		this.boot_code['Ƶ'] = '\n';
		this.boot_code['ƶ'] = '\000';
		this.boot_code['Ʒ'] = '\000';
		this.boot_code['Ƹ'] = '\000';
		this.boot_code['ƹ'] = '\000';
		this.boot_code['ƺ'] = '\000';
		this.boot_code['ƻ'] = '\000';
		this.boot_code['Ƽ'] = '\000';
		this.boot_code['ƽ'] = '¬';
		this.boot_code['ƾ'] = 'Ë';
		this.boot_code['ƿ'] = 'Ø';
	}

	public void fat32_boot_code_init() {
		this.boot_code[0] = '3';
		this.boot_code[1] = 'É';
		this.boot_code[2] = '';
		this.boot_code[3] = 'Ñ';
		this.boot_code[4] = '¼';
		this.boot_code[5] = 'ô';
		this.boot_code[6] = '{';
		this.boot_code[7] = '';
		this.boot_code[8] = 'Á';
		this.boot_code[9] = '';
		this.boot_code[10] = 'Ù';
		this.boot_code[11] = '½';
		this.boot_code[12] = '\000';
		this.boot_code[13] = '|';
		this.boot_code[14] = '';
		this.boot_code[15] = 'N';
		this.boot_code[16] = '\002';
		this.boot_code[17] = '';
		this.boot_code[18] = 'V';
		this.boot_code[19] = '@';
		this.boot_code[20] = '´';
		this.boot_code[21] = 'A';
		this.boot_code[22] = '»';
		this.boot_code[23] = 'ª';
		this.boot_code[24] = 'U';
		this.boot_code[25] = 'Í';
		this.boot_code[26] = '\023';
		this.boot_code[27] = 'r';
		this.boot_code[28] = '\020';
		this.boot_code[29] = '';
		this.boot_code[30] = 'û';
		this.boot_code[31] = 'U';
		this.boot_code[32] = 'ª';
		this.boot_code[33] = 'u';
		this.boot_code[34] = '\n';
		this.boot_code[35] = 'ö';
		this.boot_code[36] = 'Á';
		this.boot_code[37] = '\001';
		this.boot_code[38] = 't';
		this.boot_code[39] = '\005';
		this.boot_code[40] = 'þ';
		this.boot_code[41] = 'F';
		this.boot_code[42] = '\002';
		this.boot_code[43] = 'ë';
		this.boot_code[44] = '-';
		this.boot_code[45] = '';
		this.boot_code[46] = 'V';
		this.boot_code[47] = '@';
		this.boot_code[48] = '´';
		this.boot_code[49] = '\b';
		this.boot_code[50] = 'Í';
		this.boot_code[51] = '\023';
		this.boot_code[52] = 's';
		this.boot_code[53] = '\005';
		this.boot_code[54] = '¹';
		this.boot_code[55] = 'ÿ';
		this.boot_code[56] = 'ÿ';
		this.boot_code[57] = '';
		this.boot_code[58] = 'ñ';
		this.boot_code[59] = 'f';
		this.boot_code[60] = '\017';
		this.boot_code[61] = '¶';
		this.boot_code[62] = 'Æ';
		this.boot_code[63] = '@';
		this.boot_code[64] = 'f';
		this.boot_code[65] = '\017';
		this.boot_code[66] = '¶';
		this.boot_code[67] = 'Ñ';
		this.boot_code[68] = '';
		this.boot_code[69] = 'â';
		this.boot_code[70] = '?';
		this.boot_code[71] = '÷';
		this.boot_code[72] = 'â';
		this.boot_code[73] = '';
		this.boot_code[74] = 'Í';
		this.boot_code[75] = 'À';
		this.boot_code[76] = 'í';
		this.boot_code[77] = '\006';
		this.boot_code[78] = 'A';
		this.boot_code[79] = 'f';
		this.boot_code[80] = '\017';
		this.boot_code[81] = '·';
		this.boot_code[82] = 'É';
		this.boot_code[83] = 'f';
		this.boot_code[84] = '÷';
		this.boot_code[85] = 'á';
		this.boot_code[86] = 'f';
		this.boot_code[87] = '';
		this.boot_code[88] = 'F';
		this.boot_code[89] = 'ø';
		this.boot_code[90] = '';
		this.boot_code[91] = '~';
		this.boot_code[92] = '\026';
		this.boot_code[93] = '\000';
		this.boot_code[94] = 'u';
		this.boot_code[95] = '8';
		this.boot_code[96] = '';
		this.boot_code[97] = '~';
		this.boot_code[98] = '*';
		this.boot_code[99] = '\000';
		this.boot_code[100] = 'w';
		this.boot_code[101] = '2';
		this.boot_code[102] = 'f';
		this.boot_code[103] = '';
		this.boot_code[104] = 'F';
		this.boot_code[105] = '\034';
		this.boot_code[106] = 'f';
		this.boot_code[107] = '';
		this.boot_code[108] = 'À';
		this.boot_code[109] = '\f';
		this.boot_code[110] = '»';
		this.boot_code[111] = '\000';
		this.boot_code[112] = '';
		this.boot_code[113] = '¹';
		this.boot_code[114] = '\001';
		this.boot_code[115] = '\000';
		this.boot_code[116] = 'è';
		this.boot_code[117] = '+';
		this.boot_code[118] = '\000';
		this.boot_code[119] = 'é';
		this.boot_code[120] = ',';
		this.boot_code[121] = '\003';
		this.boot_code[122] = ' ';
		this.boot_code[123] = 'ú';
		this.boot_code[124] = '}';
		this.boot_code[125] = '´';
		this.boot_code[126] = '}';
		this.boot_code[127] = '';
		this.boot_code[''] = 'ð';
		this.boot_code[''] = '¬';
		this.boot_code[''] = '';
		this.boot_code[''] = 'À';
		this.boot_code[''] = 't';
		this.boot_code[''] = '\027';
		this.boot_code[''] = '<';
		this.boot_code[''] = 'ÿ';
		this.boot_code[''] = 't';
		this.boot_code[''] = '\t';
		this.boot_code[''] = '´';
		this.boot_code[''] = '\016';
		this.boot_code[''] = '»';
		this.boot_code[''] = '\007';
		this.boot_code[''] = '\000';
		this.boot_code[''] = 'Í';
		this.boot_code[''] = '\020';
		this.boot_code[''] = 'ë';
		this.boot_code[''] = 'î';
		this.boot_code[''] = ' ';
		this.boot_code[''] = 'û';
		this.boot_code[''] = '}';
		this.boot_code[''] = 'ë';
		this.boot_code[''] = 'å';
		this.boot_code[''] = ' ';
		this.boot_code[''] = 'ù';
		this.boot_code[''] = '}';
		this.boot_code[''] = 'ë';
		this.boot_code[''] = 'à';
		this.boot_code[''] = '';
		this.boot_code[''] = 'Í';
		this.boot_code[''] = '\026';
		this.boot_code[' '] = 'Í';
		this.boot_code['¡'] = '\031';
		this.boot_code['¢'] = 'f';
		this.boot_code['£'] = '`';
		this.boot_code['¤'] = '';
		this.boot_code['¥'] = '~';
		this.boot_code['¦'] = '\002';
		this.boot_code['§'] = '\000';
		this.boot_code['¨'] = '\017';
		this.boot_code['©'] = '';
		this.boot_code['ª'] = ' ';
		this.boot_code['«'] = '\000';
		this.boot_code['¬'] = 'f';
		this.boot_code['­'] = 'j';
		this.boot_code['®'] = '\000';
		this.boot_code['¯'] = 'f';
		this.boot_code['°'] = 'P';
		this.boot_code['±'] = '\006';
		this.boot_code['²'] = 'S';
		this.boot_code['³'] = 'f';
		this.boot_code['´'] = 'h';
		this.boot_code['µ'] = '\020';
		this.boot_code['¶'] = '\000';
		this.boot_code['·'] = '\001';
		this.boot_code['¸'] = '\000';
		this.boot_code['¹'] = '´';
		this.boot_code['º'] = 'B';
		this.boot_code['»'] = '';
		this.boot_code['¼'] = 'V';
		this.boot_code['½'] = '@';
		this.boot_code['¾'] = '';
		this.boot_code['¿'] = 'ô';
		this.boot_code['À'] = 'Í';
		this.boot_code['Á'] = '\023';
		this.boot_code['Â'] = 'f';
		this.boot_code['Ã'] = 'X';
		this.boot_code['Ä'] = 'f';
		this.boot_code['Å'] = 'X';
		this.boot_code['Æ'] = 'f';
		this.boot_code['Ç'] = 'X';
		this.boot_code['È'] = 'f';
		this.boot_code['É'] = 'X';
		this.boot_code['Ê'] = 'ë';
		this.boot_code['Ë'] = '3';
		this.boot_code['Ì'] = 'f';
		this.boot_code['Í'] = ';';
		this.boot_code['Î'] = 'F';
		this.boot_code['Ï'] = 'ø';
		this.boot_code['Ð'] = 'r';
		this.boot_code['Ñ'] = '\003';
		this.boot_code['Ò'] = 'ù';
		this.boot_code['Ó'] = 'ë';
		this.boot_code['Ô'] = '*';
		this.boot_code['Õ'] = 'f';
		this.boot_code['Ö'] = '3';
		this.boot_code['×'] = 'Ò';
		this.boot_code['Ø'] = 'f';
		this.boot_code['Ù'] = '\017';
		this.boot_code['Ú'] = '·';
		this.boot_code['Û'] = 'N';
		this.boot_code['Ü'] = '\030';
		this.boot_code['Ý'] = 'f';
		this.boot_code['Þ'] = '÷';
		this.boot_code['ß'] = 'ñ';
		this.boot_code['à'] = 'þ';
		this.boot_code['á'] = 'Â';
		this.boot_code['â'] = '';
		this.boot_code['ã'] = 'Ê';
		this.boot_code['ä'] = 'f';
		this.boot_code['å'] = '';
		this.boot_code['æ'] = 'Ð';
		this.boot_code['ç'] = 'f';
		this.boot_code['è'] = 'Á';
		this.boot_code['é'] = 'ê';
		this.boot_code['ê'] = '\020';
		this.boot_code['ë'] = '÷';
		this.boot_code['ì'] = 'v';
		this.boot_code['í'] = '\032';
		this.boot_code['î'] = '';
		this.boot_code['ï'] = 'Ö';
		this.boot_code['ð'] = '';
		this.boot_code['ñ'] = 'V';
		this.boot_code['ò'] = '@';
		this.boot_code['ó'] = '';
		this.boot_code['ô'] = 'è';
		this.boot_code['õ'] = 'À';
		this.boot_code['ö'] = 'ä';
		this.boot_code['÷'] = '\006';
		this.boot_code['ø'] = '\n';
		this.boot_code['ù'] = 'Ì';
		this.boot_code['ú'] = '¸';
		this.boot_code['û'] = '\001';
		this.boot_code['ü'] = '\002';
		this.boot_code['ý'] = 'Í';
		this.boot_code['þ'] = '\023';
		this.boot_code['ÿ'] = 'f';
		this.boot_code['Ā'] = 'a';
		this.boot_code['ā'] = '\017';
		this.boot_code['Ă'] = '';
		this.boot_code['ă'] = 'u';
		this.boot_code['Ą'] = 'ÿ';
		this.boot_code['ą'] = '';
		this.boot_code['Ć'] = 'Ã';
		this.boot_code['ć'] = '\000';
		this.boot_code['Ĉ'] = '\002';
		this.boot_code['ĉ'] = 'f';
		this.boot_code['Ċ'] = '@';
		this.boot_code['ċ'] = 'I';
		this.boot_code['Č'] = 'u';
		this.boot_code['č'] = '';
		this.boot_code['Ď'] = 'Ã';
		this.boot_code['ď'] = 'B';
		this.boot_code['Đ'] = 'O';
		this.boot_code['đ'] = 'O';
		this.boot_code['Ē'] = 'T';
		this.boot_code['ē'] = 'M';
		this.boot_code['Ĕ'] = 'G';
		this.boot_code['ĕ'] = 'R';
		this.boot_code['Ė'] = ' ';
		this.boot_code['ė'] = ' ';
		this.boot_code['Ę'] = ' ';
		this.boot_code['ę'] = ' ';
		this.boot_code['Ě'] = '\000';
		this.boot_code['ě'] = '\000';
		this.boot_code['Ĝ'] = '\000';
		this.boot_code['ĝ'] = '\000';
		this.boot_code['Ğ'] = '\000';
		this.boot_code['ğ'] = '\000';
		this.boot_code['Ġ'] = '\000';
		this.boot_code['ġ'] = '\000';
		this.boot_code['Ģ'] = '\000';
		this.boot_code['ģ'] = '\000';
		this.boot_code['Ĥ'] = '\000';
		this.boot_code['ĥ'] = '\000';
		this.boot_code['Ħ'] = '\000';
		this.boot_code['ħ'] = '\000';
		this.boot_code['Ĩ'] = '\000';
		this.boot_code['ĩ'] = '\000';
		this.boot_code['Ī'] = '\000';
		this.boot_code['ī'] = '\000';
		this.boot_code['Ĭ'] = '\000';
		this.boot_code['ĭ'] = '\000';
		this.boot_code['Į'] = '\000';
		this.boot_code['į'] = '\000';
		this.boot_code['İ'] = '\000';
		this.boot_code['ı'] = '\000';
		this.boot_code['Ĳ'] = '\000';
		this.boot_code['ĳ'] = '\000';
		this.boot_code['Ĵ'] = '\000';
		this.boot_code['ĵ'] = '\000';
		this.boot_code['Ķ'] = '\000';
		this.boot_code['ķ'] = '\000';
		this.boot_code['ĸ'] = '\000';
		this.boot_code['Ĺ'] = '\000';
		this.boot_code['ĺ'] = '\000';
		this.boot_code['Ļ'] = '\000';
		this.boot_code['ļ'] = '\000';
		this.boot_code['Ľ'] = '\000';
		this.boot_code['ľ'] = '\000';
		this.boot_code['Ŀ'] = '\000';
		this.boot_code['ŀ'] = '\000';
		this.boot_code['Ł'] = '\000';
		this.boot_code['ł'] = '\000';
		this.boot_code['Ń'] = '\000';
		this.boot_code['ń'] = '\000';
		this.boot_code['Ņ'] = '\000';
		this.boot_code['ņ'] = '\000';
		this.boot_code['Ň'] = '\000';
		this.boot_code['ň'] = '\000';
		this.boot_code['ŉ'] = '\000';
		this.boot_code['Ŋ'] = '\000';
		this.boot_code['ŋ'] = '\000';
		this.boot_code['Ō'] = '\000';
		this.boot_code['ō'] = '\000';
		this.boot_code['Ŏ'] = '\000';
		this.boot_code['ŏ'] = '\000';
		this.boot_code['Ő'] = '\000';
		this.boot_code['ő'] = '\000';
		this.boot_code['Œ'] = '\r';
		this.boot_code['œ'] = '\n';
		this.boot_code['Ŕ'] = 'R';
		this.boot_code['ŕ'] = 'e';
		this.boot_code['Ŗ'] = 'm';
		this.boot_code['ŗ'] = 'o';
		this.boot_code['Ř'] = 'v';
		this.boot_code['ř'] = 'e';
		this.boot_code['Ś'] = ' ';
		this.boot_code['ś'] = 'd';
		this.boot_code['Ŝ'] = 'i';
		this.boot_code['ŝ'] = 's';
		this.boot_code['Ş'] = 'k';
		this.boot_code['ş'] = 's';
		this.boot_code['Š'] = ' ';
		this.boot_code['š'] = 'o';
		this.boot_code['Ţ'] = 'r';
		this.boot_code['ţ'] = ' ';
		this.boot_code['Ť'] = 'o';
		this.boot_code['ť'] = 't';
		this.boot_code['Ŧ'] = 'h';
		this.boot_code['ŧ'] = 'e';
		this.boot_code['Ũ'] = 'r';
		this.boot_code['ũ'] = ' ';
		this.boot_code['Ū'] = 'm';
		this.boot_code['ū'] = 'e';
		this.boot_code['Ŭ'] = 'd';
		this.boot_code['ŭ'] = 'i';
		this.boot_code['Ů'] = 'a';
		this.boot_code['ů'] = '.';
		this.boot_code['Ű'] = 'ÿ';
		this.boot_code['ű'] = '\r';
		this.boot_code['Ų'] = '\n';
		this.boot_code['ų'] = 'D';
		this.boot_code['Ŵ'] = 'i';
		this.boot_code['ŵ'] = 's';
		this.boot_code['Ŷ'] = 'k';
		this.boot_code['ŷ'] = ' ';
		this.boot_code['Ÿ'] = 'e';
		this.boot_code['Ź'] = 'r';
		this.boot_code['ź'] = 'r';
		this.boot_code['Ż'] = 'o';
		this.boot_code['ż'] = 'r';
		this.boot_code['Ž'] = 'ÿ';
		this.boot_code['ž'] = '\r';
		this.boot_code['ſ'] = '\n';
		this.boot_code['ƀ'] = 'P';
		this.boot_code['Ɓ'] = 'r';
		this.boot_code['Ƃ'] = 'e';
		this.boot_code['ƃ'] = 's';
		this.boot_code['Ƅ'] = 's';
		this.boot_code['ƅ'] = ' ';
		this.boot_code['Ɔ'] = 'a';
		this.boot_code['Ƈ'] = 'n';
		this.boot_code['ƈ'] = 'y';
		this.boot_code['Ɖ'] = ' ';
		this.boot_code['Ɗ'] = 'k';
		this.boot_code['Ƌ'] = 'e';
		this.boot_code['ƌ'] = 'y';
		this.boot_code['ƍ'] = ' ';
		this.boot_code['Ǝ'] = 't';
		this.boot_code['Ə'] = 'o';
		this.boot_code['Ɛ'] = ' ';
		this.boot_code['Ƒ'] = 'r';
		this.boot_code['ƒ'] = 'e';
		this.boot_code['Ɠ'] = 's';
		this.boot_code['Ɣ'] = 't';
		this.boot_code['ƕ'] = 'a';
		this.boot_code['Ɩ'] = 'r';
		this.boot_code['Ɨ'] = 't';
		this.boot_code['Ƙ'] = '\r';
		this.boot_code['ƙ'] = '\n';
		this.boot_code['ƚ'] = '\000';
		this.boot_code['ƛ'] = '\000';
		this.boot_code['Ɯ'] = '\000';
		this.boot_code['Ɲ'] = '\000';
		this.boot_code['ƞ'] = '\000';
		this.boot_code['Ɵ'] = '¬';
		this.boot_code['Ơ'] = 'Ë';
		this.boot_code['ơ'] = 'Ø';
		this.boot_code['Ƣ'] = '\000';
		this.boot_code['ƣ'] = '\000';
	}
}

/*
 * Location: D:\Users\tianlin\Downloads\JViewer.jar!\com\ami\iusb\MBR.class Java
 * compiler version: 5 (49.0) JD-Core Version: 0.7.1
 */